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

#include <event_handler.h>

Public Member Functions

 EventHandler ()
 
TimedEventMgrgetTimer ()
 
void run ()
 
void setScreenUpdate (void(*updateScreen)(void))
 
ControllerpushController (Controller *c)
 
ControllerpopController ()
 
ControllergetController () const
 
void setController (Controller *c)
 
void pushKeyHandler (KeyHandler kh)
 
void popKeyHandler ()
 
KeyHandlergetKeyHandler () const
 
void setKeyHandler (KeyHandler kh)
 
void pushMouseAreaSet (const MouseArea *mouseAreas)
 
void popMouseAreaSet ()
 
const MouseAreagetMouseAreaSet () const
 
const MouseAreamouseAreaForPoint (int x, int y)
 
KeybindingAction getAction ()
 

Static Public Member Functions

static EventHandlergetInstance ()
 
static void sleep (uint usec)
 
static void wait_msecs (uint msecs)
 
static void wait_cycles (uint cycles)
 
static void setControllerDone (bool exit=true)
 
static bool getControllerDone ()
 
static void end ()
 

Protected Attributes

TimedEventMgr _timer
 
Std::vector< Controller * > _controllers
 
MouseAreaList _mouseAreaSets
 
updateScreenCallback _updateScreen
 

Static Protected Attributes

static bool _controllerDone
 
static bool _ended
 

Detailed Description

A class for handling game events.

Constructor & Destructor Documentation

◆ EventHandler()

Ultima::Ultima4::EventHandler::EventHandler ( )

Constructor

Member Function Documentation

◆ sleep()

static void Ultima::Ultima4::EventHandler::sleep ( uint  usec)
static

Delays program execution for the specified number of milliseconds. This doesn't actually stop events, but it stops the user from interacting While some important event happens (e.g., getting hit by a cannon ball or a spell effect).

◆ wait_msecs()

static void Ultima::Ultima4::EventHandler::wait_msecs ( uint  msecs)
static

Waits a given number of milliseconds before continuing

◆ wait_cycles()

static void Ultima::Ultima4::EventHandler::wait_cycles ( uint  cycles)
static

Waits a given number of game cycles before continuing

◆ getControllerDone()

static bool Ultima::Ultima4::EventHandler::getControllerDone ( )
static

Returns the current value of the global exit flag

◆ pushKeyHandler()

void Ultima::Ultima4::EventHandler::pushKeyHandler ( KeyHandler  kh)

Adds a key handler to the stack.

◆ popKeyHandler()

void Ultima::Ultima4::EventHandler::popKeyHandler ( )

Pops a key handler off the stack. Returns a pointer to the resulting key handler after the current handler is popped.

◆ getKeyHandler()

KeyHandler* Ultima::Ultima4::EventHandler::getKeyHandler ( ) const

Returns a pointer to the current key handler. Returns nullptr if there is no key handler.

◆ setKeyHandler()

void Ultima::Ultima4::EventHandler::setKeyHandler ( KeyHandler  kh)

Eliminates all key handlers and begins stack with new handler. This pops all key handlers off the stack and adds the key handler provided to the stack, making it the only key handler left. Use this function only if you are sure the key handlers in the stack are disposable.

◆ getMouseAreaSet()

const MouseArea* Ultima::Ultima4::EventHandler::getMouseAreaSet ( ) const

Get the currently active mouse area set off the top of the stack.

◆ getAction()

KeybindingAction Ultima::Ultima4::EventHandler::getAction ( )
inline

Checks for whether to walk, and if so, returns the direction action


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