MapTile Class Reference

#include <MapTile.h>

List of all members.


Detailed Description

Definition at line 15 of file MapTile.h.

Public Member Functions

bool addObject (spMapObject object)
void addTileInDirection (spMapTile tile, const Direction &dir)
bool addUnit (spUnit unit)
void drawObjects (Point offset) const
void drawTerrain (Point offset) const
int getCenterX () const
int getCenterY () const
int getMoveCost (const Direction &dir) const
int getScreenX () const
int getScreenY () const
TerrainType getTerrainType ()
spMapTile getTileInDirection (const Direction &dir) const
spUnit getUnit ()
int getX () const
int getY () const
bool hasObstruction (Direction dir) const
bool hasUnit () const
void highlight (Point offset)
void highlightMoveable (Point offset)
bool isPassable (Direction dir) const
bool isPassable () const
void removeObject (spMapObject object)
void removeUnit ()
 ~MapTile ()

Static Public Member Functions

static int getHeight ()
static int getWidth ()
static spMapTile makeMapTile (TerrainType type, int x, int y)

Private Member Functions

 MapTile (TerrainType type, int x, int y)

Private Attributes

int _centerX
int _centerY
list< spMapObject_objects
int _screenX
int _screenY
Terrain _terrain
spUnit _unit
wpMapTile _weak
int _x
int _y
map< Direction, spMapTiledirectionTileMap

Static Private Attributes

static int _height = 42
static SDL_Surface * _highlight = NULL
static SDL_Surface * _highlightMove = NULL
static int _width = 80
static int cardinalMoveBase = 15
static int diagonalMoveBase = 10


Constructor & Destructor Documentation

MapTile::~MapTile (  ) 

Definition at line 42 of file MapTile.cpp.

MapTile::MapTile ( TerrainType  type,
int  x,
int  y 
) [private]

Definition at line 21 of file MapTile.cpp.

References _centerX, _centerY, _height, _highlight, _highlightMove, _screenX, _screenY, _width, Singleton< T >::instance(), TILE_HIGHLIGHT, and TILE_MOVEABLE.

Referenced by makeMapTile().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

bool MapTile::addObject ( spMapObject  object  ) 

Definition at line 193 of file MapTile.cpp.

References _objects.

void MapTile::addTileInDirection ( spMapTile  tile,
const Direction dir 
)

Definition at line 212 of file MapTile.cpp.

References _weak, and directionTileMap.

bool MapTile::addUnit ( spUnit  unit  ) 

Definition at line 170 of file MapTile.cpp.

References _unit, and isPassable().

Here is the call graph for this function:

void MapTile::drawObjects ( Point  offset  )  const

Definition at line 88 of file MapTile.cpp.

References _height, _objects, _screenX, _screenY, _unit, _width, Point::x, and Point::y.

void MapTile::drawTerrain ( Point  offset  )  const

Definition at line 83 of file MapTile.cpp.

References _screenX, _screenY, _terrain, Terrain::draw(), Point::x, and Point::y.

Here is the call graph for this function:

int MapTile::getCenterX (  )  const

Definition at line 62 of file MapTile.cpp.

References _centerX.

int MapTile::getCenterY (  )  const

Definition at line 66 of file MapTile.cpp.

References _centerY.

int MapTile::getHeight (  )  [static]

Definition at line 78 of file MapTile.cpp.

References _height.

Referenced by Map::getTile(), and MainGameState::init().

Here is the caller graph for this function:

int MapTile::getMoveCost ( const Direction dir  )  const

Definition at line 232 of file MapTile.cpp.

References cardinalMoveBase, diagonalMoveBase, and getTileInDirection().

Here is the call graph for this function:

int MapTile::getScreenX (  )  const

Definition at line 54 of file MapTile.cpp.

References _screenX.

int MapTile::getScreenY (  )  const

Definition at line 58 of file MapTile.cpp.

References _screenY.

TerrainType MapTile::getTerrainType (  ) 

Definition at line 70 of file MapTile.cpp.

References _terrain, and Terrain::getType().

Here is the call graph for this function:

spMapTile MapTile::getTileInDirection ( const Direction dir  )  const

Definition at line 218 of file MapTile.cpp.

References directionTileMap.

Referenced by getMoveCost(), and isPassable().

Here is the caller graph for this function:

spUnit MapTile::getUnit (  ) 

Definition at line 183 of file MapTile.cpp.

References _unit.

int MapTile::getWidth (  )  [static]

Definition at line 74 of file MapTile.cpp.

References _width.

Referenced by Map::getTile(), and MainGameState::init().

Here is the caller graph for this function:

int MapTile::getX (  )  const

Definition at line 46 of file MapTile.cpp.

References _x.

int MapTile::getY (  )  const

Definition at line 50 of file MapTile.cpp.

References _y.

bool MapTile::hasObstruction ( Direction  dir  )  const

Definition at line 151 of file MapTile.cpp.

References _objects.

Referenced by isPassable().

Here is the caller graph for this function:

bool MapTile::hasUnit (  )  const

Definition at line 165 of file MapTile.cpp.

References _unit.

Referenced by isPassable().

Here is the caller graph for this function:

void MapTile::highlight ( Point  offset  ) 

Definition at line 108 of file MapTile.cpp.

References _highlight, _screenX, _screenY, Singleton< T >::instance(), Point::x, and Point::y.

Here is the call graph for this function:

void MapTile::highlightMoveable ( Point  offset  ) 

Definition at line 113 of file MapTile.cpp.

References _highlightMove, _screenX, _screenY, Singleton< T >::instance(), Point::x, and Point::y.

Here is the call graph for this function:

bool MapTile::isPassable ( Direction  dir  )  const

Definition at line 141 of file MapTile.cpp.

References getTileInDirection(), and hasObstruction().

Here is the call graph for this function:

bool MapTile::isPassable (  )  const

Definition at line 118 of file MapTile.cpp.

References _objects, _terrain, hasUnit(), and Terrain::isPassable().

Referenced by addUnit().

Here is the call graph for this function:

Here is the caller graph for this function:

spMapTile MapTile::makeMapTile ( TerrainType  type,
int  x,
int  y 
) [static]

Definition at line 14 of file MapTile.cpp.

References MapTile().

Referenced by Map::load().

Here is the call graph for this function:

Here is the caller graph for this function:

void MapTile::removeObject ( spMapObject  object  ) 

Definition at line 207 of file MapTile.cpp.

References _objects.

void MapTile::removeUnit (  ) 

Definition at line 188 of file MapTile.cpp.

References _unit.


Member Data Documentation

int MapTile::_centerX [private]

Definition at line 61 of file MapTile.h.

Referenced by getCenterX(), and MapTile().

int MapTile::_centerY [private]

Definition at line 62 of file MapTile.h.

Referenced by getCenterY(), and MapTile().

int MapTile::_height = 42 [static, private]

Definition at line 64 of file MapTile.h.

Referenced by drawObjects(), getHeight(), and MapTile().

SDL_Surface * MapTile::_highlight = NULL [static, private]

Definition at line 66 of file MapTile.h.

Referenced by highlight(), and MapTile().

SDL_Surface * MapTile::_highlightMove = NULL [static, private]

Definition at line 67 of file MapTile.h.

Referenced by highlightMoveable(), and MapTile().

list<spMapObject> MapTile::_objects [private]

Definition at line 71 of file MapTile.h.

Referenced by addObject(), drawObjects(), hasObstruction(), isPassable(), and removeObject().

int MapTile::_screenX [private]

Definition at line 59 of file MapTile.h.

Referenced by drawObjects(), drawTerrain(), getScreenX(), highlight(), highlightMoveable(), and MapTile().

int MapTile::_screenY [private]

Definition at line 60 of file MapTile.h.

Referenced by drawObjects(), drawTerrain(), getScreenY(), highlight(), highlightMoveable(), and MapTile().

Terrain MapTile::_terrain [private]

Definition at line 68 of file MapTile.h.

Referenced by drawTerrain(), getTerrainType(), and isPassable().

spUnit MapTile::_unit [private]

Definition at line 70 of file MapTile.h.

Referenced by addUnit(), drawObjects(), getUnit(), hasUnit(), and removeUnit().

wpMapTile MapTile::_weak [private]

Definition at line 55 of file MapTile.h.

Referenced by addTileInDirection().

int MapTile::_width = 80 [static, private]

Definition at line 63 of file MapTile.h.

Referenced by drawObjects(), getWidth(), and MapTile().

int MapTile::_x [private]

Definition at line 57 of file MapTile.h.

Referenced by getX().

int MapTile::_y [private]

Definition at line 58 of file MapTile.h.

Referenced by getY().

int MapTile::cardinalMoveBase = 15 [static, private]

Definition at line 74 of file MapTile.h.

Referenced by getMoveCost().

int MapTile::diagonalMoveBase = 10 [static, private]

Definition at line 75 of file MapTile.h.

Referenced by getMoveCost().

map<Direction, spMapTile> MapTile::directionTileMap [private]

Definition at line 72 of file MapTile.h.

Referenced by addTileInDirection(), and getTileInDirection().


The documentation for this class was generated from the following files:
Generated on Fri Sep 22 06:00:27 2006 for X-CLONE by  doxygen 1.4.7