#include <game_base.h>
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::VisualItem * | getView () const |
void | setFont (Gfx::Font *font) |
Gfx::Font * | getFont () const |
virtual Maps::Map * | getMap () 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 () |
TreeItem * | getParent () const |
Game * | getGame () |
const Game * | getGame () const |
Gfx::VisualItem * | getView () |
TreeItem * | getNextSibling () const |
TreeItem * | getPriorSibling () const |
TreeItem * | getLastSibling () |
TreeItem * | getFirstChild () const |
TreeItem * | getLastChild () const |
TreeItem * | scan (TreeItem *item) const |
TreeItem * | findChildInstanceOf (const ClassDef &classDef) const |
TreeItem * | findNextInstanceOf (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) |
NamedItem * | findByName (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 | |
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 () |
Base class for the game implementations
Ultima::Shared::GameBase::GameBase | ( | ) |
Constructor
|
override |
Destructor
|
overridevirtual |
Called to handle any regular updates the game requires
Reimplemented from Ultima::Shared::EventTarget.
|
overridevirtual |
Mouse/key event handlers
Reimplemented from Ultima::Shared::EventTarget.
|
inlinevirtual |
Called when the game starts
Reimplemented in Ultima::Ultima1::Ultima1Game.
|
inlinevirtual |
Returns true if the current video mode is VGA
Reimplemented in Ultima::Ultima1::Ultima1Game.
void Ultima::Shared::GameBase::update | ( | ) |
Called once every frame to update the game and render the view
void Ultima::Shared::GameBase::mouseChanged | ( | ) |
Called by the event handler when a mouse event has been generated
void Ultima::Shared::GameBase::setView | ( | Gfx::VisualItem * | view | ) |
Set the currently active view to display
void Ultima::Shared::GameBase::setView | ( | const Common::String & | viewName | ) |
Set the currently active view to display
void Ultima::Shared::GameBase::setPopup | ( | Gfx::Popup * | popup | ) |
Sets a popup to be shown
|
inline |
Returns the current view
void Ultima::Shared::GameBase::setFont | ( | Gfx::Font * | font | ) |
Set a font to use
|
inline |
Returns the current font
|
inlinevirtual |
Returns the map
Reimplemented in Ultima::Shared::Game.
uint Ultima::Shared::GameBase::getRandomNumber | ( | uint | max | ) |
Gets a random number
uint Ultima::Shared::GameBase::getRandomNumber | ( | uint | min, |
uint | max | ||
) |
Gets a random number
void Ultima::Shared::GameBase::sleep | ( | uint | time | ) |
Wait for a given period of time
uint32 Ultima::Shared::GameBase::getMillis | ( | ) | const |
Return the current time
|
inlinevirtual |
Returns true if a savegame can currently be loaded
|
inlinevirtual |
Returns true if the game can currently be saved
Reimplemented in Ultima::Ultima1::Ultima1Game.
|
virtual |
Handles loading and saving games
Reimplemented in Ultima::Shared::Game, and Ultima::Ultima1::Ultima1Game.