ScummVM API documentation
Ultima::Ultima4::GameController Class Reference

#include <game_controller.h>

Inheritance diagram for Ultima::Ultima4::GameController:
Ultima::Ultima4::Controller Ultima::Ultima4::Observer< Party *, PartyEvent &> Ultima::Ultima4::Observer< Location *, MoveEvent &> Ultima::Ultima4::TurnCompleter

Public Member Functions

void setActive () override
 
void keybinder (KeybindingAction action) override
 
bool mousePressed (const Common::Point &mousePos) override
 
void timerFired () override
 
void init ()
 
void initScreen ()
 
void initScreenWithoutReloadingState ()
 
void setMap (Map *map, bool saveLocation, const Portal *portal, TurnCompleter *turnCompleter=nullptr)
 
int exitToParentMap ()
 
void finishTurnAfterCombatEnds () override
 
void finishTurn () override
 
void update (Party *party, PartyEvent &event) override
 
void update (Location *location, MoveEvent &event) override
 
void initMoons ()
 
void updateMoons (bool showmoongates)
 
void attack (Direction dir=DIR_NONE)
 
- Public Member Functions inherited from Ultima::Ultima4::Controller
 Controller (int timerInterval=1)
 
virtual bool isCombatController () const
 
bool notifyKeyPressed (int key)
 
bool notifyMousePress (const Common::Point &mousePos)
 
int getTimerInterval ()
 
virtual bool keyPressed (int key)
 
bool shouldQuit () const
 

Static Public Member Functions

static void flashTile (const Coords &coords, MapTile tile, int timeFactor)
 
static void flashTile (const Coords &coords, const Common::String &tilename, int timeFactor)
 
static void doScreenAnimationsWhilePausing (int timeFactor)
 
- Static Public Member Functions inherited from Ultima::Ultima4::Controller
static void timerCallback (void *data)
 

Public Attributes

TileView _mapArea
 
bool _paused
 
int _pausedTimer
 
bool _combatFinished
 

Detailed Description

The main game controller that handles basic game flow and keypresses.

  • separate the dungeon specific stuff into another class (subclass?)

Member Function Documentation

◆ flashTile()

static void Ultima::Ultima4::GameController::flashTile ( const Coords coords,
MapTile  tile,
int  timeFactor 
)
static

Show an attack flash at x, y on the current map. This is used for 'being hit' or 'being missed' by weapons, cannon fire, spells, etc.

◆ setActive()

void Ultima::Ultima4::GameController::setActive ( )
overridevirtual

Called when a controller is made active

Reimplemented from Ultima::Ultima4::Controller.

◆ keybinder()

void Ultima::Ultima4::GameController::keybinder ( KeybindingAction  action)
overridevirtual

Keybinder actions

Reimplemented from Ultima::Ultima4::Controller.

◆ mousePressed()

bool Ultima::Ultima4::GameController::mousePressed ( const Common::Point mousePos)
overridevirtual

Mouse button was pressed

Reimplemented from Ultima::Ultima4::Controller.

◆ timerFired()

void Ultima::Ultima4::GameController::timerFired ( )
overridevirtual

This function is called every quarter second.

Reimplemented from Ultima::Ultima4::Controller.

◆ exitToParentMap()

int Ultima::Ultima4::GameController::exitToParentMap ( )

Exits the current map and location and returns to its parent location This restores all relevant information from the previous location, such as the map, map position, etc. (such as exiting a city)

◆ finishTurnAfterCombatEnds()

void Ultima::Ultima4::GameController::finishTurnAfterCombatEnds ( )
inlineoverridevirtual

Finishes the game turn after combat ends. It suppresses monster movement to prevent issues, such as infinite combat at the Shrine of Humility

Reimplemented from Ultima::Ultima4::TurnCompleter.

◆ finishTurn()

void Ultima::Ultima4::GameController::finishTurn ( )
overridevirtual

Terminates a game turn. This performs the post-turn housekeeping tasks like adjusting the party's food, incrementing the number of moves, etc.

Implements Ultima::Ultima4::TurnCompleter.

◆ update() [1/2]

void Ultima::Ultima4::GameController::update ( Party party,
PartyEvent event 
)
overridevirtual

Provide feedback to user after a party event happens.

Implements Ultima::Ultima4::Observer< Party *, PartyEvent &>.

◆ update() [2/2]

void Ultima::Ultima4::GameController::update ( Location location,
MoveEvent event 
)
overridevirtual

Provide feedback to user after a movement event happens.

Implements Ultima::Ultima4::Observer< Location *, MoveEvent &>.

◆ initMoons()

void Ultima::Ultima4::GameController::initMoons ( )

Initializes the moon state according to the savegame file. This method of initializing the moons (rather than just setting them directly) is necessary to make sure trammel and felucca stay in sync

◆ updateMoons()

void Ultima::Ultima4::GameController::updateMoons ( bool  showmoongates)

Updates the phases of the moons and shows the visual moongates on the map, if desired


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