#include <unit.h>
Inheritance diagram for unit:
Public Member Functions | |
unit (int x, int y, unit *target=0) | |
Create a unit. | |
unit (int x, int y, int r, int g, int b, unit *target=0) | |
Create a unit. | |
unit (int x, int y, float r, float g, float b, unit *target=0) | |
Create a unit. | |
virtual | ~unit () |
virtual const char * | getName () |
virtual tDirection | makeMove (mapProvider *mp, reservationProvider *rp, simulationInfo *simInfo) |
The new makeMove only gives a map. | |
void | getLocation (int &x, int &y) |
get where the unit thinks it is | |
virtual void | updateLocation (int _x, int _y, bool, simulationInfo *) |
updateLocation only tells a unit where it is located, it doesn't physically change the location in the world | |
virtual void | logStats (statCollection *stats) |
log an stats that may have been computed during the last run | |
virtual void | logFinalStats (statCollection *) |
log any final one-time stats before a simulation is ended | |
virtual double | getSpeed () |
void | setSpeed (double s) |
virtual bool | done () |
unit * | getTarget () |
virtual void | setTarget (unit *u) |
void | setColor (GLfloat _r, GLfloat _g, GLfloat _b) |
void | getColor (GLfloat &_r, GLfloat &_g, GLfloat &_b) |
virtual void | openGLDraw (mapProvider *, simulationInfo *simInfo) |
Draw the unit. | |
void | setObjectType (tObjectType _unitType) |
tObjectType | getObjectType () |
unitGroup * | getUnitGroup () |
void | setUnitGroup (unitGroup *_group) |
void | getOpenGLLocation (Map *map, GLdouble &_x, GLdouble &_y, GLdouble &_z, GLdouble &radius) |
Get OpenGL coordinates of unit. | |
int | getUnitID () |
Static Public Member Functions | |
void | clearDisplayList () |
Protected Member Functions | |
void | drawTriangle (GLdouble x, GLdouble y, GLdouble z, GLdouble tRadius) |
Draw a triangle for the unit. | |
void | drawSphere (GLdouble x, GLdouble y, GLdouble z, GLdouble tRadius) |
Draw a dome for the unit. | |
bool | mapUpdated (mapAbstraction *aMap) |
is map updated? | |
Protected Attributes | |
tObjectType | unitType |
int | map_revision |
int | x |
int | y |
GLfloat | r |
GLfloat | g |
GLfloat | b |
double | speed |
unit * | target |
unitGroup * | group |
int | id |
Static Protected Attributes | |
GLuint | sphereDispList = 0 |
int | unitID = 0 |
|
Create a unit. Create a unit starting at a given x/y location, with a potential target. |
|
Create a unit. Create a unit starting at a given x/y location, r/g/b (0.255), with a potential target. |
|
Create a unit. Create a unit starting at a given x/y location, r/g/b (0.255), with a potential target. |
|
|
|
|
|
Reimplemented in KoenigsUnit, LRTAStarUnit, patUnit, PrioritizedUnit, PRLRTSkUnit, and searchUnit. |
|
Draw a dome for the unit. Draw a dome at the coordinates specified; used for all other units by default. |
|
Draw a triangle for the unit. Draw's a pyramid at the location specified. Used for drawing kDisplayOnly objects. |
|
|
|
get where the unit thinks it is returns the current unit location by reference |
|
Reimplemented in KoenigsUnit, PrioritizedUnit, PRLRTSkUnit, patrolUnit, praStarUnit, rewardUnit, rewardSeekingUnit, searchUnit, randomUnit, billiardBallUnit, and randomerUnit. |
|
|
|
Get OpenGL coordinates of unit. Returns the x/y/z open GL coordinates of a unit, as well as the radius of the unit in the world. |
|
|
|
Reimplemented in patrolUnit. |
|
|
|
|
|
log any final one-time stats before a simulation is ended
Reimplemented in patrolUnit, and searchUnit. |
|
log an stats that may have been computed during the last run No stats collected by default. Reimplemented in KoenigsUnit, PrioritizedUnit, PRLRTSkUnit, patrolUnit, and searchUnit. |
|
The new makeMove only gives a map. The unit simulation won't calculate an mapAbstraction unless it has to. Thus, in simple pathfinding tests, the overhead is saved. Reimplemented in KoenigsUnit, LRTAStarUnit, PrioritizedUnit, PRLRTSkUnit, humanUnit, patrolUnit, praStarUnit, rewardSeekingUnit, searchUnit, randomUnit, billiardBallUnit, randomerUnit, rhrUnit, and teleportUnit. |
|
is map updated? returns true if the map has been udpated from the last time we checked. |
|
Draw the unit. Draw the unit using openGL. Overload this if you want a custom look for the unit. Reimplemented in patrolUnit, rewardUnit, rewardSeekingUnit, and searchUnit. |
|
|
|
|
|
|
|
|
|
|
|
updateLocation only tells a unit where it is located, it doesn't physically change the location in the world
Reimplemented in patrolUnit, searchUnit, randomUnit, billiardBallUnit, rhrUnit, and teleportUnit. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|