#include <map.h>
Public Member Functions | |
MapBase (Game *game, Map *map) | |
virtual | ~MapBase () |
virtual void | synchronize (Common::Serializer &s) |
void | addWidget (MapWidget *widget) |
void | removeWidget (MapWidget *widget) |
virtual void | clear () |
virtual void | getTileAt (const Point &pt, MapTile *tile) |
void | resetViewport () |
virtual Point | getViewportPosition (const Point &viewportSize) |
virtual void | load (MapId mapId) |
virtual bool | changeLevel (int delta) |
virtual uint | getLevel () const |
virtual bool | isMapWrapped () const |
size_t | width () const |
size_t | height () const |
Point | getPosition () const |
void | setPosition (const Point &pt) |
Direction | getDirection () const |
void | setDirection (Direction dir) |
Point | getDirectionDelta () const |
virtual Point | getDeltaPosition (const Point &delta) |
MapId | getMapId () const |
uint | getMapIndex () const |
virtual void | shiftViewport (const Point &delta) |
virtual void | update () |
Public Attributes | |
Point | _size |
Point | _tilesPerOrigTile |
Common::String | _name |
MapWidget * | _playerWidget |
Common::Array< MapWidgetPtr > | _widgets |
Common::Array< MapCellsRow > | _data |
Protected Member Functions | |
void | setDimensions (const Point &size) |
Protected Attributes | |
MapId | _mapId |
uint | _mapIndex |
uint | _mapStyle |
ViewportPosition | _viewportPos |
Base class for specific map types
|
inlinevirtual |
Destructor
|
protected |
Set the size of the map
|
virtual |
Handles loading and saving the map's data
void Ultima::Shared::Map::MapBase::addWidget | ( | MapWidget * | widget | ) |
Adds a widget to the map
void Ultima::Shared::Map::MapBase::removeWidget | ( | MapWidget * | widget | ) |
Removes a widget from the map
|
virtual |
Clears all map data
Gets a tile at a given position
void Ultima::Shared::Map::MapBase::resetViewport | ( | ) |
Resets the viewport when the viewport changes
|
virtual |
Get the viewport position
|
virtual |
Load the map
|
inlinevirtual |
Changes the level. Only applicable to dungeon maps which have levels
delta | Delta to change dungeon level by |
|
inlinevirtual |
Get the current map level
|
inlinevirtual |
Returns whether the map wraps around to the other side at it's edges (i.e. the overworld)
|
inline |
Returns the width of the map
|
inline |
Returns the height of the map
Point Ultima::Shared::Map::MapBase::getPosition | ( | ) | const |
Get the current position
void Ultima::Shared::Map::MapBase::setPosition | ( | const Point & | pt | ) |
Set the current position
Direction Ultima::Shared::Map::MapBase::getDirection | ( | ) | const |
Get the current direction
void Ultima::Shared::Map::MapBase::setDirection | ( | Direction | dir | ) |
Set the current direction
Point Ultima::Shared::Map::MapBase::getDirectionDelta | ( | ) | const |
Returns a delta for the cell in front of the player based on the direction they're facing
Gets a point relative to the current position
|
inline |
Returns the map Id
|
inline |
Gets the map Index
|
virtual |
Shifts the viewport by a given delta
|
virtual |
Updates the map at the end of a turn