ScummVM API documentation
Ultima::Shared::Maps::MapBase Class Referenceabstract

#include <map_base.h>

Inheritance diagram for Ultima::Shared::Maps::MapBase:
Ultima::Ultima1::Maps::MapBase Ultima::Ultima1::Maps::MapCityCastle Ultima::Ultima1::Maps::MapDungeon Ultima::Ultima1::Maps::MapOverworld Ultima::Ultima1::Maps::MapCastle Ultima::Ultima1::Maps::MapCity

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 MapWidgetcreateWidget (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
 

Detailed Description

Base class for specific map types

Constructor & Destructor Documentation

◆ MapBase()

Ultima::Shared::Maps::MapBase::MapBase ( Game game,
Map  
)
inline

Constructor

◆ ~MapBase()

virtual Ultima::Shared::Maps::MapBase::~MapBase ( )
inlinevirtual

Destructor

Reimplemented in Ultima::Ultima1::Maps::MapBase.

Member Function Documentation

◆ setDimensions()

void Ultima::Shared::Maps::MapBase::setDimensions ( const Point size)
protected

Set the size of the map

◆ addInfoMsg()

void Ultima::Shared::Maps::MapBase::addInfoMsg ( const Common::String text,
bool  newLine = true,
bool  replaceLine = false 
)
protected

Adds a text string to the info area

Parameters
textText to add
newLineWhether to apply a newline at the end
replaceLineIf true, replaces the current last line

◆ synchronize()

virtual void Ultima::Shared::Maps::MapBase::synchronize ( Common::Serializer s)
virtual

Handles loading and saving the map's data

Reimplemented in Ultima::Ultima1::Maps::MapCastle, and Ultima::Ultima1::Maps::MapDungeon.

◆ addWidget()

void Ultima::Shared::Maps::MapBase::addWidget ( MapWidget widget)

Adds a widget to the map

◆ removeWidget()

void Ultima::Shared::Maps::MapBase::removeWidget ( MapWidget widget)

Removes a widget from the map

◆ clear()

virtual void Ultima::Shared::Maps::MapBase::clear ( )
virtual

Clears all map data

Reimplemented in Ultima::Ultima1::Maps::MapCityCastle.

◆ getTileAt()

virtual void Ultima::Shared::Maps::MapBase::getTileAt ( const Point pt,
MapTile tile,
bool  includePlayer = true 
)
virtual

◆ setTileAt()

virtual void Ultima::Shared::Maps::MapBase::setTileAt ( const Point pt,
uint  tileId 
)
virtual

Sets a tile at a given position

◆ resetViewport()

void Ultima::Shared::Maps::MapBase::resetViewport ( )

Resets the viewport when the viewport changes

◆ getViewportPosition()

virtual Point Ultima::Shared::Maps::MapBase::getViewportPosition ( const Point viewportSize)
virtual

Get the viewport position

Reimplemented in Ultima::Ultima1::Maps::MapCityCastle, and Ultima::Ultima1::Maps::MapOverworld.

◆ load()

virtual void Ultima::Shared::Maps::MapBase::load ( MapId  mapId)
virtual

◆ changeLevel()

virtual bool Ultima::Shared::Maps::MapBase::changeLevel ( int  delta)
inlinevirtual

Changes the level. Only applicable to dungeon maps which have levels

Parameters
deltaDelta to change dungeon level by
Returns
False if dungeon left, true if still within dungeon

Reimplemented in Ultima::Ultima1::Maps::MapDungeon.

◆ getLevel()

virtual uint Ultima::Shared::Maps::MapBase::getLevel ( ) const
inlinevirtual

Get the current map level

Reimplemented in Ultima::Ultima1::Maps::MapDungeon.

◆ isMapWrapped()

virtual bool Ultima::Shared::Maps::MapBase::isMapWrapped ( ) const
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.

◆ createWidget()

virtual MapWidget* Ultima::Shared::Maps::MapBase::createWidget ( const Common::String name)
pure virtual

Instantiates a widget type by name

Implemented in Ultima::Ultima1::Maps::MapBase.

◆ width()

size_t Ultima::Shared::Maps::MapBase::width ( ) const
inline

Returns the width of the map

◆ height()

size_t Ultima::Shared::Maps::MapBase::height ( ) const
inline

Returns the height of the map

◆ getPosition()

Point Ultima::Shared::Maps::MapBase::getPosition ( ) const

Get the current position

◆ setPosition()

void Ultima::Shared::Maps::MapBase::setPosition ( const Point pt)

Set the current position

◆ getDirection()

Direction Ultima::Shared::Maps::MapBase::getDirection ( ) const

Get the current direction

◆ setDirection()

void Ultima::Shared::Maps::MapBase::setDirection ( Direction  dir)

Set the current direction

◆ getDirectionDelta()

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

◆ getDeltaPosition()

virtual Point Ultima::Shared::Maps::MapBase::getDeltaPosition ( const Point delta)
virtual

Gets a point relative to the current position

Reimplemented in Ultima::Ultima1::Maps::MapOverworld.

◆ getMapId()

MapId Ultima::Shared::Maps::MapBase::getMapId ( ) const
inline

Returns the map Id

◆ getMapIndex()

uint Ultima::Shared::Maps::MapBase::getMapIndex ( ) const
inline

Gets the map Index

◆ getMapStyle()

uint Ultima::Shared::Maps::MapBase::getMapStyle ( ) const
inline

Gets the map style

◆ shiftViewport()

virtual void Ultima::Shared::Maps::MapBase::shiftViewport ( const Point delta)
virtual

Shifts the viewport by a given delta

Reimplemented in Ultima::Ultima1::Maps::MapOverworld.

◆ update()

virtual void Ultima::Shared::Maps::MapBase::update ( )
virtual

Updates the map at the end of a turn

Reimplemented in Ultima::Ultima1::Maps::MapDungeon.

◆ castSpell()

virtual void Ultima::Shared::Maps::MapBase::castSpell ( uint  spell)
pure virtual

Cast a specific spell

Implemented in Ultima::Ultima1::Maps::MapDungeon, and Ultima::Ultima1::Maps::MapBase.


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