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

#include <map_widget.h>

Inheritance diagram for Ultima::Shared::Maps::MapWidget:
Ultima::Shared::MessageTarget Ultima::Shared::BaseObject Ultima::Shared::Maps::DungeonWidget Ultima::Ultima1::Widgets::AttackEffect Ultima::Ultima1::Widgets::OverworldWidget Ultima::Ultima1::Widgets::UrbanWidget Ultima::Ultima1::Widgets::DungeonPlayer Ultima::Ultima1::Widgets::DungeonWidget Ultima::Ultima1::Widgets::PhysicalAttackEffect Ultima::Ultima1::Widgets::SpellAttackEffect Ultima::Ultima1::Widgets::OverworldMonster Ultima::Ultima1::Widgets::Transport Ultima::Ultima1::Widgets::TransportOnFoot Ultima::Ultima1::Widgets::Person

Public Types

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

Public Member Functions

 MapWidget (Game *game, MapBase *map)
 
 MapWidget (Game *game, MapBase *map, const Point &pt, Direction dir=DIR_NONE)
 
 MapWidget (Game *game, MapBase *map, const Common::String &name, const Point &pt, Direction dir=DIR_NONE)
 
 ~MapWidget () override
 
virtual const char * getClassName () const
 
virtual void synchronize (Common::Serializer &s)
 
void addInfoMsg (const Common::String &text, bool newLine=true, bool replaceLine=false)
 
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 Member Functions inherited from Ultima::Shared::BaseObject
virtual ::Ultima::Shared::ClassDef getType () const
 
bool isInstanceOf (const ClassDef &classDef) const
 

Static Public Member Functions

static Direction directionFromKey (Common::KeyCode keycode)
 
- Static Public Member Functions inherited from Ultima::Shared::BaseObject
::Ultima::Shared::ClassDef type ()
 

Public Attributes

Point _position
 
Direction _direction
 
Common::String _name
 
 CLASSDEF
 
- Public Attributes inherited from Ultima::Shared::MessageTarget
 CLASSDEF
 

Protected Attributes

Game_game
 
MapBase_map
 

Additional Inherited Members

- Protected Member Functions inherited from Ultima::Shared::MessageTarget
virtual const Ultima::Shared::MSGMAPgetMessageMap () const
 
- Static Protected Member Functions inherited from Ultima::Shared::MessageTarget
static const Ultima::Shared::MSGMAPgetThisMessageMap ()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ MapWidget()

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

Constructor

◆ ~MapWidget()

Ultima::Shared::Maps::MapWidget::~MapWidget ( )
inlineoverride

Destructor

Member Function Documentation

◆ directionFromKey()

static Direction Ultima::Shared::Maps::MapWidget::directionFromKey ( Common::KeyCode  keycode)
static

Support method to get a direction from a keycode

◆ getClassName()

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

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

◆ synchronize()

◆ addInfoMsg()

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

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

◆ getTileNum()

◆ isBlocking()

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

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

Reimplemented in Ultima::Ultima1::Widgets::Transport.

◆ update()

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

Called to update the widget at the end of a turn

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

Reimplemented in Ultima::Ultima1::Widgets::DungeonMonster.

◆ canMoveTo()

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

◆ moveTo()

virtual void Ultima::Shared::Maps::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

Reimplemented in Ultima::Ultima1::Widgets::UrbanPlayer.


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