ScummVM API documentation
Ultima::Shared::Map Class Referenceabstract

#include <map.h>

Classes

class  MapBase
 

Public Member Functions

 Map ()
 
virtual ~Map ()
 
virtual void load (MapId mapId)
 
virtual void clear ()
 
virtual void synchronize (Common::Serializer &s)
 
virtual MapWidgetcreateWidget (Map::MapBase *map, const Common::String &name)=0
 
void getTileAt (const Point &pt, MapTile *tile)
 
Point getViewportPosition (const Point &viewportSize)
 
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
 
Point getDeltaPosition (const Point &delta)
 
void shiftViewport (const Point &delta)
 
Point getTilesPerOrigTile () const
 
Common::String getName () const
 
MapWidgetgetPlayerWidget () const
 
bool changeLevel (int delta)
 
uint getLevel () const
 
bool isMapWrapped () const
 
void update ()
 

Protected Attributes

MapBase_mapArea
 

Detailed Description

Base class for managing maps within the game

Constructor & Destructor Documentation

◆ Map()

Ultima::Shared::Map::Map ( )
inline

Constructor

◆ ~Map()

virtual Ultima::Shared::Map::~Map ( )
inlinevirtual

Destructor

Member Function Documentation

◆ load()

virtual void Ultima::Shared::Map::load ( MapId  mapId)
virtual

Load a given map

◆ clear()

virtual void Ultima::Shared::Map::clear ( )
virtual

Clears all map data

◆ synchronize()

virtual void Ultima::Shared::Map::synchronize ( Common::Serializer s)
virtual

Handles loading and saving the map's data

◆ createWidget()

virtual MapWidget* Ultima::Shared::Map::createWidget ( Map::MapBase map,
const Common::String name 
)
pure virtual

Instantiates a widget type by name

◆ getTileAt()

void Ultima::Shared::Map::getTileAt ( const Point pt,
MapTile tile 
)
inline

Gets a tile at a given position

◆ getViewportPosition()

Point Ultima::Shared::Map::getViewportPosition ( const Point viewportSize)
inline

Get the viewport position

◆ width()

size_t Ultima::Shared::Map::width ( ) const
inline

Return the width of the map

◆ height()

size_t Ultima::Shared::Map::height ( ) const
inline

Return the height of the map

◆ getPosition()

Point Ultima::Shared::Map::getPosition ( ) const
inline

Return the current position

◆ setPosition()

void Ultima::Shared::Map::setPosition ( const Point pt)
inline

Set the position

◆ getDirection()

Direction Ultima::Shared::Map::getDirection ( ) const
inline

Get the current direction

◆ setDirection()

void Ultima::Shared::Map::setDirection ( Direction  dir)
inline

Set the current direction

◆ getDirectionDelta()

Point Ultima::Shared::Map::getDirectionDelta ( ) const
inline

Returns a delta for the cell in front of the player based on the direction they're facing

◆ getDeltaPosition()

Point Ultima::Shared::Map::getDeltaPosition ( const Point delta)
inline

Gets a point relative to the current position

◆ shiftViewport()

void Ultima::Shared::Map::shiftViewport ( const Point delta)
inline

Shifts the viewport by a given delta

◆ getTilesPerOrigTile()

Point Ultima::Shared::Map::getTilesPerOrigTile ( ) const
inline

Returns the number of tiles in the map there are for each tile in the original game. This allows for more detailed maps in the enhanced game modes

◆ getName()

Common::String Ultima::Shared::Map::getName ( ) const
inline

Return the name of the map

◆ getPlayerWidget()

MapWidget* Ultima::Shared::Map::getPlayerWidget ( ) const
inline

Returns the currently active widget that the player is controlling

◆ changeLevel()

bool Ultima::Shared::Map::changeLevel ( int  delta)
inline
Parameters
deltaDelta to change dungeon level by
Returns
False if dungeon left, true if still within dungeon

◆ getLevel()

uint Ultima::Shared::Map::getLevel ( ) const
inline

Get the current map level

◆ isMapWrapped()

bool Ultima::Shared::Map::isMapWrapped ( ) const
inline

Returns whether the map wraps around to the other side at it's edges (i.e. the overworld)

◆ update()

void Ultima::Shared::Map::update ( )
inline

Updates the map at the end of a turn


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