HOG2
|
A unit which randomly teleports around the world. More...
#include <RandomUnits.h>
Public Member Functions | |
TeleportUnit (int x, int y, int _stayTime) | |
const char * | GetName () |
bool | MakeMove (MapEnvironment *, OccupancyInterface< xyLoc, tDirection > *, MapSimulationInfo *, tDirection &dir) |
make teleport move. More... | |
Public Member Functions inherited from MapUnit | |
MapUnit (int x, int y) | |
virtual void | UpdateLocation (MapEnvironment *, xyLoc &l, bool, MapSimulationInfo *) |
virtual void | GetLocation (xyLoc &l) |
virtual void | OpenGLDraw (const MapEnvironment *, const MapSimulationInfo *) const |
virtual void | GetGoal (xyLoc &s) |
Public Member Functions inherited from Unit< xyLoc, tDirection, MapEnvironment > | |
Unit () | |
virtual | ~Unit () |
virtual bool | Done () |
virtual double | GetSpeed () |
void | SetSpeed (double s) |
virtual void | LogStats (StatCollection *) |
log an stats that may have been computed during the last run More... | |
virtual void | LogFinalStats (StatCollection *) |
log any final one-time stats before a simulation is ended More... | |
virtual void | SetColor (GLfloat _r, GLfloat _g, GLfloat _b) |
virtual void | GetColor (GLfloat &_r, GLfloat &_g, GLfloat &_b) const |
UnitGroup< xyLoc, tDirection, MapEnvironment > * | GetUnitGroup () |
void | SetUnitGroup (UnitGroup< xyLoc, tDirection, MapEnvironment > *_group) |
virtual unsigned int | GetNum () |
virtual void | SetNum (unsigned int num) |
virtual void | StartNewTrial (StatCollection *) |
virtual int | GetPriority () |
virtual void | SetPriority (int val) |
Private Attributes | |
int | stayTime |
int | timer |
Additional Inherited Members | |
Protected Attributes inherited from MapUnit | |
GLfloat | r |
GLfloat | g |
GLfloat | b |
xyLoc | loc |
A unit which randomly teleports around the world.
Definition at line 37 of file RandomUnits.h.
|
inline |
Definition at line 39 of file RandomUnits.h.
|
inlinevirtual |
Implements Unit< xyLoc, tDirection, MapEnvironment >.
Definition at line 41 of file RandomUnits.h.
|
virtual |
make teleport move.
the teleport unit stays put for some # moves, and then teleports to a new random location.
Implements Unit< xyLoc, tDirection, MapEnvironment >.
Definition at line 101 of file RandomUnits.cpp.
References MapEnvironment::GetMap(), Map::GetMapHeight(), Map::GetMapWidth(), kStay, kTeleport, stayTime, timer, loc::x, and loc::y.
|
private |
Definition at line 45 of file RandomUnits.h.
Referenced by MakeMove().
|
private |
Definition at line 46 of file RandomUnits.h.
Referenced by MakeMove().