#include <map_base.h>
Public Member Functions | |
MapBase (Game *game, 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, bool includePlayer=true) |
virtual void | setTileAt (const Point &pt, uint tileId) |
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 |
virtual MapWidget * | createWidget (const Common::String &name)=0 |
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 |
uint | getMapStyle () const |
virtual void | shiftViewport (const Point &delta) |
virtual void | update () |
virtual void | castSpell (uint spell)=0 |
Public Attributes | |
Point | _size |
Point | _tilesPerOrigTile |
Common::String | _name |
MapWidget * | _playerWidget |
WidgetsArray | _widgets |
Protected Member Functions | |
void | setDimensions (const Point &size) |
void | addInfoMsg (const Common::String &text, bool newLine=true, bool replaceLine=false) |
Protected Attributes | |
MapId | _mapId |
uint | _mapIndex |
uint | _mapStyle |
ViewportPosition | _viewportPos |
Common::Array< MapCellsRow > | _data |
Base class for specific map types
|
inlinevirtual |
Destructor
Reimplemented in Ultima::Ultima1::Maps::MapBase.
|
protected |
Set the size of the map
|
protected |
Adds a text string to the info area
text | Text to add |
newLine | Whether to apply a newline at the end |
replaceLine | If true, replaces the current last line |
|
virtual |
Handles loading and saving the map's data
Reimplemented in Ultima::Ultima1::Maps::MapCastle, and Ultima::Ultima1::Maps::MapDungeon.
void Ultima::Shared::Maps::MapBase::addWidget | ( | MapWidget * | widget | ) |
Adds a widget to the map
void Ultima::Shared::Maps::MapBase::removeWidget | ( | MapWidget * | widget | ) |
Removes a widget from the map
|
virtual |
Clears all map data
Reimplemented in Ultima::Ultima1::Maps::MapCityCastle.
|
virtual |
Gets a tile at a given position
Reimplemented in Ultima::Ultima1::Maps::MapDungeon, Ultima::Ultima1::Maps::MapCityCastle, and Ultima::Ultima1::Maps::MapBase.
|
virtual |
Sets a tile at a given position
void Ultima::Shared::Maps::MapBase::resetViewport | ( | ) |
Resets the viewport when the viewport changes
|
virtual |
Get the viewport position
Reimplemented in Ultima::Ultima1::Maps::MapCityCastle, and Ultima::Ultima1::Maps::MapOverworld.
|
virtual |
Load the map
Reimplemented in Ultima::Ultima1::Maps::MapCastle, Ultima::Ultima1::Maps::MapCity, Ultima::Ultima1::Maps::MapDungeon, Ultima::Ultima1::Maps::MapCityCastle, and Ultima::Ultima1::Maps::MapOverworld.
|
inlinevirtual |
Changes the level. Only applicable to dungeon maps which have levels
delta | Delta to change dungeon level by |
Reimplemented in Ultima::Ultima1::Maps::MapDungeon.
|
inlinevirtual |
Get the current map level
Reimplemented in Ultima::Ultima1::Maps::MapDungeon.
|
inlinevirtual |
Returns whether the map wraps around to the other side at it's edges (i.e. the overworld)
Reimplemented in Ultima::Ultima1::Maps::MapOverworld.
|
pure virtual |
Instantiates a widget type by name
Implemented in Ultima::Ultima1::Maps::MapBase.
|
inline |
Returns the width of the map
|
inline |
Returns the height of the map
Point Ultima::Shared::Maps::MapBase::getPosition | ( | ) | const |
Get the current position
void Ultima::Shared::Maps::MapBase::setPosition | ( | const Point & | pt | ) |
Set the current position
Direction Ultima::Shared::Maps::MapBase::getDirection | ( | ) | const |
Get the current direction
void Ultima::Shared::Maps::MapBase::setDirection | ( | Direction | dir | ) |
Set the current direction
Point Ultima::Shared::Maps::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
Reimplemented in Ultima::Ultima1::Maps::MapOverworld.
|
inline |
Returns the map Id
|
inline |
Gets the map Index
|
inline |
Gets the map style
|
virtual |
Shifts the viewport by a given delta
Reimplemented in Ultima::Ultima1::Maps::MapOverworld.
|
virtual |
Updates the map at the end of a turn
Reimplemented in Ultima::Ultima1::Maps::MapDungeon.
|
pure virtual |
Cast a specific spell
Implemented in Ultima::Ultima1::Maps::MapDungeon, and Ultima::Ultima1::Maps::MapBase.