#include <MapTile.h>
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, spMapTile > | directionTileMap |
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 |
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:
bool MapTile::addObject | ( | spMapObject | object | ) |
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 |
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 |
int MapTile::getCenterY | ( | ) | const |
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 |
int MapTile::getScreenY | ( | ) | const |
TerrainType MapTile::getTerrainType | ( | ) |
Definition at line 70 of file MapTile.cpp.
References _terrain, and Terrain::getType().
Here is the call graph for this function:
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 | ( | ) |
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 |
int MapTile::getY | ( | ) | const |
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 | ) |
void MapTile::removeUnit | ( | ) |
int MapTile::_centerX [private] |
int MapTile::_centerY [private] |
int MapTile::_height = 42 [static, private] |
SDL_Surface * MapTile::_highlight = NULL [static, private] |
SDL_Surface * MapTile::_highlightMove = NULL [static, private] |
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] |
int MapTile::_width = 80 [static, private] |
int MapTile::_x [private] |
int MapTile::_y [private] |
int MapTile::cardinalMoveBase = 15 [static, private] |
int MapTile::diagonalMoveBase = 10 [static, private] |
map<Direction, spMapTile> MapTile::directionTileMap [private] |
Definition at line 72 of file MapTile.h.
Referenced by addTileInDirection(), and getTileInDirection().