Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

randomUnit Class Reference

A unit that moves in random directions changing direction randomly. More...

#include <unit.h>

Inheritance diagram for randomUnit:

Inheritance graph
[legend]
Collaboration diagram for randomUnit:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 randomUnit (int _x, int _y)
 randomUnit (int _x, int _y, int _r, int _g, int _b)
tDirection makeMove (mapProvider *mp, reservationProvider *rp, simulationInfo *simInfo)
 Make a random move.

void updateLocation (int _x, int _y, bool, simulationInfo *)
 Set location after last move.

virtual const char * getName ()

Private Attributes

int lastIndex

Detailed Description

A unit that moves in random directions changing direction randomly.


Constructor & Destructor Documentation

randomUnit::randomUnit int  _x,
int  _y
[inline]
 

randomUnit::randomUnit int  _x,
int  _y,
int  _r,
int  _g,
int  _b
[inline]
 


Member Function Documentation

virtual const char* randomUnit::getName  )  [inline, virtual]
 

Reimplemented from unit.

tDirection randomUnit::makeMove mapProvider mp,
reservationProvider rp,
simulationInfo simInfo
[virtual]
 

Make a random move.

the random unit follows a certain direction for a random amount of time, and then picks a new direction. makeMove just returns the current direction.

Reimplemented from unit.

void randomUnit::updateLocation int  _x,
int  _y,
bool  success,
simulationInfo
[virtual]
 

Set location after last move.

After moving, the unit picks a new random direction if the move wasn't a success. If it was, it has a 5% chance of changing direction.

Reimplemented from unit.


Member Data Documentation

int randomUnit::lastIndex [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Aug 18 03:45:15 2009 for HOG by doxygen 1.3.4