ScummVM API documentation
Ultima::Shared::Maps::Map Class Reference

#include <map.h>

Inheritance diagram for Ultima::Shared::Maps::Map:
Ultima::Ultima1::Maps::Ultima1Map

Public Member Functions

 Map ()
 
virtual ~Map ()
 
virtual void load (MapId mapId)
 
virtual void clear ()
 
virtual void synchronize (Common::Serializer &s)
 
MapWidgetcreateWidget (const Common::String &name)
 
void getTileAt (const Point &pt, MapTile *tile, bool includePlayer=true)
 
void setTileAt (const Point &pt, uint tileId)
 
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 ()
 
void castSpell (uint spellId)
 

Protected Attributes

MapBase_mapArea
 

Detailed Description

Base class for managing maps within the game

Constructor & Destructor Documentation

◆ Map()

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

Constructor

◆ ~Map()

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

Destructor

Member Function Documentation

◆ load()

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

Load a given map

Reimplemented in Ultima::Ultima1::Maps::Ultima1Map.

◆ clear()

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

Clears all map data

Reimplemented in Ultima::Ultima1::Maps::Ultima1Map.

◆ synchronize()

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

Handles loading and saving the map's data

Reimplemented in Ultima::Ultima1::Maps::Ultima1Map.

◆ createWidget()

MapWidget* Ultima::Shared::Maps::Map::createWidget ( const Common::String name)
inline

Instantiates a widget type by name

◆ getTileAt()

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

Gets a tile at a given position

◆ setTileAt()

void Ultima::Shared::Maps::Map::setTileAt ( const Point pt,
uint  tileId 
)
inline

Sets a tile at a given position

◆ getViewportPosition()

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

Get the viewport position

◆ width()

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

Return the width of the map

◆ height()

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

Return the height of the map

◆ getPosition()

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

Return the current position

◆ setPosition()

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

Set the position

◆ getDirection()

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

Get the current direction

◆ setDirection()

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

Set the current direction

◆ getDirectionDelta()

Point Ultima::Shared::Maps::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::Maps::Map::getDeltaPosition ( const Point delta)
inline

Gets a point relative to the current position

◆ shiftViewport()

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

Shifts the viewport by a given delta

◆ getTilesPerOrigTile()

Point Ultima::Shared::Maps::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::Maps::Map::getName ( ) const
inline

Return the name of the map

◆ getPlayerWidget()

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

Returns the currently active widget that the player is controlling

◆ changeLevel()

bool Ultima::Shared::Maps::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::Maps::Map::getLevel ( ) const
inline

Get the current map level

◆ isMapWrapped()

bool Ultima::Shared::Maps::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::Maps::Map::update ( )
inline

Updates the map at the end of a turn

◆ castSpell()

void Ultima::Shared::Maps::Map::castSpell ( uint  spellId)
inline

Cast a specific spell


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