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

#include <game_base.h>

Inheritance diagram for Ultima::Shared::GameBase:
Ultima::Shared::TreeItem Ultima::Shared::EventTarget Ultima::Shared::MessageTarget Ultima::Shared::BaseObject Ultima::Shared::Game Ultima::Ultima0::Ultima0Game Ultima::Ultima1::Ultima1Game

Public Member Functions

 GameBase ()
 
 ~GameBase () override
 
void onIdle () override
 
void mouseMove (const Point &mousePos) override
 
void leftButtonDown (const Point &mousePos) override
 
void leftButtonUp (const Point &mousePos) override
 
void middleButtonDown (const Point &mousePos) override
 
void middleButtonUp (const Point &mousePos) override
 
void rightButtonDown (const Point &mousePos) override
 
void rightButtonUp (const Point &mousePos) override
 
void mouseWheel (const Point &mousePos, bool wheelUp) override
 
void keyDown (Common::KeyState keyState) override
 
virtual void starting (bool isLoading)
 
virtual bool isVGA () const
 
void update ()
 
void mouseChanged ()
 
void setView (Gfx::VisualItem *view)
 
void setView (const Common::String &viewName)
 
void setPopup (Gfx::Popup *popup)
 
Gfx::VisualItemgetView () const
 
void setFont (Gfx::Font *font)
 
Gfx::FontgetFont () const
 
virtual Maps::MapgetMap () const
 
uint getRandomNumber (uint max)
 
uint getRandomNumber (uint min, uint max)
 
void sleep (uint time)
 
uint32 getMillis () const
 
virtual bool canLoadGameStateCurrently ()
 
virtual bool canSaveGameStateCurrently ()
 
virtual void synchronize (Common::Serializer &s)
 
- Public Member Functions inherited from Ultima::Shared::TreeItem
virtual const Common::String getName () const
 
virtual bool isEquals (const Common::String &name, int maxLen=0) const
 
virtual int compareTo (const Common::String &name, int maxLen=0) const
 
virtual void viewChange ()
 
TreeItemgetParent () const
 
GamegetGame ()
 
const GamegetGame () const
 
Gfx::VisualItemgetView ()
 
TreeItemgetNextSibling () const
 
TreeItemgetPriorSibling () const
 
TreeItemgetLastSibling ()
 
TreeItemgetFirstChild () const
 
TreeItemgetLastChild () const
 
TreeItemscan (TreeItem *item) const
 
TreeItemfindChildInstanceOf (const ClassDef &classDef) const
 
TreeItemfindNextInstanceOf (const ClassDef &classDef, TreeItem *startItem) const
 
void addUnder (TreeItem *newParent)
 
void addChild (TreeItem *child)
 
void setParent (TreeItem *newParent)
 
void addSibling (TreeItem *item)
 
void moveUnder (TreeItem *newParent)
 
void destroyAll ()
 
int destroyChildren ()
 
void detach ()
 
void attach (TreeItem *item)
 
NamedItemfindByName (const Common::String &name)
 
- Public Member Functions inherited from Ultima::Shared::BaseObject
virtual ::Ultima::Shared::ClassDef getType () const
 
bool isInstanceOf (const ClassDef &classDef) const
 
- Public Member Functions inherited from Ultima::Shared::EventTarget
virtual void keyUp (Common::KeyState keyState)
 

Public Attributes

Gfx::TextCursor_textCursor
 
uint _videoMode
 
- Public Attributes inherited from Ultima::Shared::TreeItem
 CLASSDEF
 
- Public Attributes inherited from Ultima::Shared::MessageTarget
 CLASSDEF
 

Protected Attributes

uint32 _priorLeftDownTime
 
uint32 _priorMiddleDownTime
 
uint32 _priorRightDownTime
 
Gfx::VisualItem_currentView
 
Gfx::Popup_pendingPopup
 
InputHandler _inputHandler
 
InputTranslator _inputTranslator
 
Gfx::Font_font
 

Additional Inherited Members

- Static Public Member Functions inherited from Ultima::Shared::BaseObject
::Ultima::Shared::ClassDef type ()
 
- 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 the game implementations

Constructor & Destructor Documentation

◆ GameBase()

Ultima::Shared::GameBase::GameBase ( )

Constructor

◆ ~GameBase()

Ultima::Shared::GameBase::~GameBase ( )
override

Destructor

Member Function Documentation

◆ onIdle()

void Ultima::Shared::GameBase::onIdle ( )
overridevirtual

Called to handle any regular updates the game requires

Reimplemented from Ultima::Shared::EventTarget.

◆ mouseMove()

void Ultima::Shared::GameBase::mouseMove ( const Point mousePos)
overridevirtual

Mouse/key event handlers

Reimplemented from Ultima::Shared::EventTarget.

◆ starting()

virtual void Ultima::Shared::GameBase::starting ( bool  isLoading)
inlinevirtual

Called when the game starts

Reimplemented in Ultima::Ultima1::Ultima1Game.

◆ isVGA()

virtual bool Ultima::Shared::GameBase::isVGA ( ) const
inlinevirtual

Returns true if the current video mode is VGA

Reimplemented in Ultima::Ultima1::Ultima1Game.

◆ update()

void Ultima::Shared::GameBase::update ( )

Called once every frame to update the game and render the view

◆ mouseChanged()

void Ultima::Shared::GameBase::mouseChanged ( )

Called by the event handler when a mouse event has been generated

◆ setView() [1/2]

void Ultima::Shared::GameBase::setView ( Gfx::VisualItem view)

Set the currently active view to display

◆ setView() [2/2]

void Ultima::Shared::GameBase::setView ( const Common::String viewName)

Set the currently active view to display

◆ setPopup()

void Ultima::Shared::GameBase::setPopup ( Gfx::Popup popup)

Sets a popup to be shown

◆ getView()

Gfx::VisualItem* Ultima::Shared::GameBase::getView ( ) const
inline

Returns the current view

◆ setFont()

void Ultima::Shared::GameBase::setFont ( Gfx::Font font)

Set a font to use

◆ getFont()

Gfx::Font* Ultima::Shared::GameBase::getFont ( ) const
inline

Returns the current font

◆ getMap()

virtual Maps::Map* Ultima::Shared::GameBase::getMap ( ) const
inlinevirtual

Returns the map

Reimplemented in Ultima::Shared::Game.

◆ getRandomNumber() [1/2]

uint Ultima::Shared::GameBase::getRandomNumber ( uint  max)

Gets a random number

◆ getRandomNumber() [2/2]

uint Ultima::Shared::GameBase::getRandomNumber ( uint  min,
uint  max 
)

Gets a random number

◆ sleep()

void Ultima::Shared::GameBase::sleep ( uint  time)

Wait for a given period of time

◆ getMillis()

uint32 Ultima::Shared::GameBase::getMillis ( ) const

Return the current time

◆ canLoadGameStateCurrently()

virtual bool Ultima::Shared::GameBase::canLoadGameStateCurrently ( )
inlinevirtual

Returns true if a savegame can currently be loaded

◆ canSaveGameStateCurrently()

virtual bool Ultima::Shared::GameBase::canSaveGameStateCurrently ( )
inlinevirtual

Returns true if the game can currently be saved

Reimplemented in Ultima::Ultima1::Ultima1Game.

◆ synchronize()

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

Handles loading and saving games

Reimplemented in Ultima::Shared::Game, and Ultima::Ultima1::Ultima1Game.


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