#include <unit.h>
Inheritance diagram for randomUnit:
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 |
|
|
|
|
|
Reimplemented from unit. |
|
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. |
|
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. |
|
|