#include <event_handler.h>
Public Member Functions | |
EventHandler () | |
TimedEventMgr * | getTimer () |
void | run () |
void | setScreenUpdate (void(*updateScreen)(void)) |
Controller * | pushController (Controller *c) |
Controller * | popController () |
Controller * | getController () const |
void | setController (Controller *c) |
void | pushKeyHandler (KeyHandler kh) |
void | popKeyHandler () |
KeyHandler * | getKeyHandler () const |
void | setKeyHandler (KeyHandler kh) |
void | pushMouseAreaSet (const MouseArea *mouseAreas) |
void | popMouseAreaSet () |
const MouseArea * | getMouseAreaSet () const |
const MouseArea * | mouseAreaForPoint (int x, int y) |
KeybindingAction | getAction () |
Static Public Member Functions | |
static EventHandler * | getInstance () |
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 |
A class for handling game events.
Ultima::Ultima4::EventHandler::EventHandler | ( | ) |
Constructor
|
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).
|
static |
Waits a given number of milliseconds before continuing
|
static |
Waits a given number of game cycles before continuing
|
static |
Returns the current value of the global exit flag
void Ultima::Ultima4::EventHandler::pushKeyHandler | ( | KeyHandler | kh | ) |
Adds a key handler to the stack.
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.
KeyHandler* Ultima::Ultima4::EventHandler::getKeyHandler | ( | ) | const |
Returns a pointer to the current key handler. Returns nullptr if there is no key handler.
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.
const MouseArea* Ultima::Ultima4::EventHandler::getMouseAreaSet | ( | ) | const |
Get the currently active mouse area set off the top of the stack.
|
inline |
Checks for whether to walk, and if so, returns the direction action