ScummVM API documentation
Ultima::Shared::MapWidget Class Reference

#include <map.h>

Inheritance diagram for Ultima::Shared::MapWidget:
Ultima::Shared::DungeonWidget Ultima::Shared::StandardWidget Ultima::Ultima1::WidgetPlayer Ultima::Shared::Creature

Public Types

enum  CanMove { UNSET = 0, YES = 1, NO = 2 }
 

Public Member Functions

 MapWidget (Game *game, Map::MapBase *map)
 
 MapWidget (Game *game, Map::MapBase *map, const Point &pt, Direction dir=DIR_NONE)
 
 MapWidget (Game *game, Map::MapBase *map, const Common::String &name, const Point &pt, Direction dir=DIR_NONE)
 
virtual ~MapWidget ()
 
virtual const char * getClassName () const
 
virtual void synchronize (Common::Serializer &s)
 
void addInfoMsg (const Common::String &text, bool newLine=true)
 
virtual uint getTileNum () const
 
virtual bool isBlocking () const
 
virtual void update (bool isPreUpdate)
 
virtual CanMove canMoveTo (const Point &destPos)
 
virtual void moveTo (const Point &destPos, Direction dir=DIR_NONE)
 

Public Attributes

Point _position
 
Direction _direction
 
Common::String _name
 

Protected Attributes

Game_game
 
Map::MapBase_map
 

Detailed Description

Base class for things that appear within a map, such as monsters, transports, or people

Constructor & Destructor Documentation

◆ MapWidget()

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

Constructor

◆ ~MapWidget()

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

Destructor

Member Function Documentation

◆ getClassName()

virtual const char* Ultima::Shared::MapWidget::getClassName ( ) const
inlinevirtual

Return a name for a widget class if it can be synchronized to savegames

◆ synchronize()

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

Handles loading and saving games

Reimplemented in Ultima::Shared::Creature.

◆ addInfoMsg()

void Ultima::Shared::MapWidget::addInfoMsg ( const Common::String text,
bool  newLine = true 
)

Adds a text string to the info area

Parameters
textText to add
newLineWhether to apply a newline at the end

◆ getTileNum()

virtual uint Ultima::Shared::MapWidget::getTileNum ( ) const
inlinevirtual

Get the tile for the widget

Reimplemented in Ultima::Ultima1::WidgetPlayer.

◆ isBlocking()

virtual bool Ultima::Shared::MapWidget::isBlocking ( ) const
inlinevirtual

Returns true if the player can move onto a tile the widget occupies

◆ update()

virtual void Ultima::Shared::MapWidget::update ( bool  isPreUpdate)
inlinevirtual

Called to update the widget at the end of a turn

Parameters
isPreUpdateUpdate is called twice in succesion during the end of turn update. Once with true for all widgets, then with it false

Reimplemented in Ultima::Shared::Creature.

◆ canMoveTo()

virtual CanMove Ultima::Shared::MapWidget::canMoveTo ( const Point destPos)
virtual

Returns true if the given widget can move to a given position on the map

◆ moveTo()

virtual void Ultima::Shared::MapWidget::moveTo ( const Point destPos,
Direction  dir = DIR_NONE 
)
virtual

Moves the widget to a given position

Parameters
destPosSpecified new position
dirOptional explicit direction to set. If not specified, the direction will be set relative to the position moved from

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