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

#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
 

Detailed Description

Base class for specific map types

Constructor & Destructor Documentation

◆ MapBase()

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

Constructor

◆ ~MapBase()

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

Destructor

Member Function Documentation

◆ setDimensions()

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

Set the size of the map

◆ synchronize()

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

Handles loading and saving the map's data

◆ addWidget()

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

Adds a widget to the map

◆ removeWidget()

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

Removes a widget from the map

◆ clear()

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

Clears all map data

◆ getTileAt()

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

Gets a tile at a given position

◆ resetViewport()

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

Resets the viewport when the viewport changes

◆ getViewportPosition()

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

Get the viewport position

◆ load()

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

Load the map

◆ changeLevel()

virtual bool Ultima::Shared::Map::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

◆ getLevel()

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

Get the current map level

◆ isMapWrapped()

virtual bool Ultima::Shared::Map::MapBase::isMapWrapped ( ) const
inlinevirtual

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

◆ width()

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

Returns the width of the map

◆ height()

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

Returns the height of the map

◆ getPosition()

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

Get the current position

◆ setPosition()

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

Set the current position

◆ getDirection()

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

Get the current direction

◆ setDirection()

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

Set the current direction

◆ getDirectionDelta()

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

◆ getDeltaPosition()

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

Gets a point relative to the current position

◆ getMapId()

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

Returns the map Id

◆ getMapIndex()

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

Gets the map Index

◆ shiftViewport()

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

Shifts the viewport by a given delta

◆ update()

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

Updates the map at the end of a turn


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