HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BaseMapOccupancyInterface Class Reference

#include <Map2DEnvironment.h>

Inheritance diagram for BaseMapOccupancyInterface:
Inheritance graph
[legend]
Collaboration diagram for BaseMapOccupancyInterface:
Collaboration graph
[legend]

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...
 

Detailed Description

Definition at line 82 of file Map2DEnvironment.h.

Constructor & Destructor Documentation

◆ BaseMapOccupancyInterface()

BaseMapOccupancyInterface::BaseMapOccupancyInterface ( Map m)

Constructor for the BaseMapOccupancyInterface.

Author
Renee Jansen
Date
08/22/2007
Parameters
mThe map to which the occupancy interface applies

Definition at line 1543 of file Map2DEnvironment.cpp.

References Map::GetMapHeight(), and Map::GetMapWidth().

◆ ~BaseMapOccupancyInterface()

BaseMapOccupancyInterface::~BaseMapOccupancyInterface ( )
virtual

Destructor for the BaseMapOccupancyInterface.

Author
Renee Jansen
Date
08/22/2007

Definition at line 1562 of file Map2DEnvironment.cpp.

Member Function Documentation

◆ CalculateIndex()

long BaseMapOccupancyInterface::CalculateIndex ( uint16_t  x,
uint16_t  y 
)
private

used to compute index into bitvector

Gets the index into the bitvector.

Converts (x,y) locations to a position in the bitvector.

Author
Renee Jansen
Date
08/22/2007
Parameters
xThe x-coordinate of the location
yThe y-coordinate of the location
Returns
The index into the bit vector

Definition at line 1613 of file Map2DEnvironment.cpp.

◆ CanMove()

bool BaseMapOccupancyInterface::CanMove ( const xyLoc ,
const xyLoc l2 
)
virtual

◆ GetStateOccupied()

bool BaseMapOccupancyInterface::GetStateOccupied ( const xyLoc s)
virtual

Returns the occupancy of a state.

Author
Renee Jansen
Date
08/22/2007
Parameters
sThe state for which we want to know the occupancy information
Returns
True if the state is occupied, false otherwise.

Implements OccupancyInterface< xyLoc, tDirection >.

Definition at line 1593 of file Map2DEnvironment.cpp.

References xyLoc::x, and xyLoc::y.

Referenced by GraphOccupancyInterface::GetStateOccupied().

◆ MoveUnitOccupancy()

void BaseMapOccupancyInterface::MoveUnitOccupancy ( const xyLoc oldState,
const xyLoc newState 
)
virtual

Updates the occupancy interface when a unit moves.

Sets the old location to be not occupied, and the new location to be occupied.

Author
Renee Jansen
Date
09/17/2007
Parameters
oldStateThe unit's previous state
newStateThe unit's new state

Implements OccupancyInterface< xyLoc, tDirection >.

Definition at line 1629 of file Map2DEnvironment.cpp.

Referenced by GraphOccupancyInterface::MoveUnitOccupancy().

◆ SetStateOccupied()

void BaseMapOccupancyInterface::SetStateOccupied ( const xyLoc s,
bool  occupied 
)
virtual

Sets the occupancy of a state.

Author
Renee Jansen
Date
08/22/2007
Parameters
sThe state for which we want to set the occupancy
occupiedWhether 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().

Member Data Documentation

◆ bitvec

std::vector<bool> BaseMapOccupancyInterface::bitvec
private

Definition at line 94 of file Map2DEnvironment.h.

◆ mapHeight

long BaseMapOccupancyInterface::mapHeight
private

Used to compute index into bitvector.

Definition at line 96 of file Map2DEnvironment.h.

◆ mapWidth

long BaseMapOccupancyInterface::mapWidth
private

Definition at line 95 of file Map2DEnvironment.h.


The documentation for this class was generated from the following files: