HOG2
|
#include <Map2DEnvironment.h>
Public Member Functions | |
BaseMapOccupancyInterface (Map *m) | |
Constructor for the BaseMapOccupancyInterface. More... | |
virtual | ~BaseMapOccupancyInterface () |
Destructor for the BaseMapOccupancyInterface. More... | |
virtual void | SetStateOccupied (const xyLoc &, bool) |
Sets the occupancy of a state. More... | |
virtual bool | GetStateOccupied (const xyLoc &) |
Returns the occupancy of a state. More... | |
virtual bool | CanMove (const xyLoc &, const xyLoc &) |
virtual void | MoveUnitOccupancy (const xyLoc &, const xyLoc &) |
Updates the occupancy interface when a unit moves. More... | |
Public Member Functions inherited from OccupancyInterface< xyLoc, tDirection > | |
virtual | ~OccupancyInterface () |
Private Member Functions | |
long | CalculateIndex (uint16_t x, uint16_t y) |
used to compute index into bitvector More... | |
Private Attributes | |
std::vector< bool > | bitvec |
long | mapWidth |
long | mapHeight |
Used to compute index into bitvector. More... | |
Definition at line 82 of file Map2DEnvironment.h.
BaseMapOccupancyInterface::BaseMapOccupancyInterface | ( | Map * | m | ) |
Constructor for the BaseMapOccupancyInterface.
m | The map to which the occupancy interface applies |
Definition at line 1543 of file Map2DEnvironment.cpp.
References Map::GetMapHeight(), and Map::GetMapWidth().
|
virtual |
Destructor for the BaseMapOccupancyInterface.
Definition at line 1562 of file Map2DEnvironment.cpp.
|
private |
used to compute index into bitvector
Gets the index into the bitvector.
Converts (x,y) locations to a position in the bitvector.
x | The x-coordinate of the location |
y | The y-coordinate of the location |
Definition at line 1613 of file Map2DEnvironment.cpp.
Implements OccupancyInterface< xyLoc, tDirection >.
Definition at line 1635 of file Map2DEnvironment.cpp.
Referenced by GraphOccupancyInterface::CanMove().
|
virtual |
Returns the occupancy of a state.
s | The state for which we want to know the occupancy information |
Implements OccupancyInterface< xyLoc, tDirection >.
Definition at line 1593 of file Map2DEnvironment.cpp.
References xyLoc::x, and xyLoc::y.
Referenced by GraphOccupancyInterface::GetStateOccupied().
|
virtual |
Updates the occupancy interface when a unit moves.
Sets the old location to be not occupied, and the new location to be occupied.
oldState | The unit's previous state |
newState | The unit's new state |
Implements OccupancyInterface< xyLoc, tDirection >.
Definition at line 1629 of file Map2DEnvironment.cpp.
Referenced by GraphOccupancyInterface::MoveUnitOccupancy().
|
virtual |
Sets the occupancy of a state.
s | The state for which we want to set the occupancy |
occupied | Whether or not the state is occupied |
Implements OccupancyInterface< xyLoc, tDirection >.
Definition at line 1576 of file Map2DEnvironment.cpp.
References xyLoc::x, and xyLoc::y.
Referenced by GraphOccupancyInterface::SetStateOccupied().
|
private |
Definition at line 94 of file Map2DEnvironment.h.
|
private |
Used to compute index into bitvector.
Definition at line 96 of file Map2DEnvironment.h.
|
private |
Definition at line 95 of file Map2DEnvironment.h.