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

#include <controller.h>

Inheritance diagram for Ultima::Ultima4::Controller:
Ultima::Ultima4::CombatController Ultima::Ultima4::GameController Ultima::Ultima4::IntroController Ultima::Ultima4::KeyHandlerController Ultima::Ultima4::WaitableController< T > Ultima::Ultima4::WaitController Ultima::Ultima4::WaitableController< Common::String > Ultima::Ultima4::WaitableController< Direction > Ultima::Ultima4::WaitableController< int > Ultima::Ultima4::WaitableController< void *>

Public Member Functions

 Controller (int timerInterval=1)
 
virtual bool isCombatController () const
 
bool notifyKeyPressed (int key)
 
bool notifyMousePress (const Common::Point &mousePos)
 
int getTimerInterval ()
 
virtual void setActive ()
 
virtual bool keyPressed (int key)
 
virtual bool mousePressed (const Common::Point &mousePos)
 
virtual void keybinder (KeybindingAction action)
 
virtual void timerFired ()
 
bool shouldQuit () const
 

Static Public Member Functions

static void timerCallback (void *data)
 

Detailed Description

A generic controller base class. Controllers are classes that contain the logic for responding to external events (e.g. keyboard, mouse, timers).

Member Function Documentation

◆ notifyKeyPressed()

bool Ultima::Ultima4::Controller::notifyKeyPressed ( int  key)

The event manager will call this method to notify the active controller that a key has been pressed. The key will be passed on to the virtual keyPressed method.

◆ notifyMousePress()

bool Ultima::Ultima4::Controller::notifyMousePress ( const Common::Point mousePos)

The event manager will call this method to notify that the left button was clicked

◆ timerCallback()

static void Ultima::Ultima4::Controller::timerCallback ( void *  data)
static

A simple adapter to make a timer callback into a controller method call.

◆ setActive()

virtual void Ultima::Ultima4::Controller::setActive ( )
virtual

control methods subclasses may want to override Called when a controller is made active

Reimplemented in Ultima::Ultima4::GameController, Ultima::Ultima4::CombatController, Ultima::Ultima4::MenuController, and Ultima::Ultima4::ReadDirController.

◆ keyPressed()

◆ mousePressed()

◆ keybinder()

◆ timerFired()

virtual void Ultima::Ultima4::Controller::timerFired ( )
virtual

The default timerFired handler for a controller. By default, timers are ignored, but subclasses can override this method and it will be called every <interval> 1/4 seconds.

Reimplemented in Ultima::Ultima4::GameController, Ultima::Ultima4::IntroController, and Ultima::Ultima4::WaitController.

◆ shouldQuit()

bool Ultima::Ultima4::Controller::shouldQuit ( ) const

Returns true if game should quit


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