Bromeon
Public Attributes
thor::ActionContext< ActionIdentifier > Struct Template Reference

Structure containing information about the context in which an action has occurred. More...

List of all members.

Public Attributes

sf::Window * Window
 Pointer to sf::Window passed to the action map.
const sf::Event * Event
 Pointer to a sf::Event that contributed to this action's activation.
ActionIdentifier ActionId
 Identifier of the action.

Detailed Description

template<typename ActionIdentifier>
struct thor::ActionContext< ActionIdentifier >

Structure containing information about the context in which an action has occurred.

This structure aggregates the events and the realtime input that were used to activate a specific action. Its objects are passed to the EventSystem class, which makes it possible for listener functions to get information about the action's trigger (e.g. the sf::Event::KeyPressed event for key presses).

See also:
ActionMap::InvokeCallbacks()

Member Data Documentation

template<typename ActionIdentifier>
ActionIdentifier thor::ActionContext< ActionIdentifier >::ActionId

Identifier of the action.

This is the ID referring to this action, used as argument for ActionMap::operator[] and EventSystem::Connect().

template<typename ActionIdentifier>
const sf::Event* thor::ActionContext< ActionIdentifier >::Event

Pointer to a sf::Event that contributed to this action's activation.

Do not store the pointer. It is a null pointer if the action hasn't been triggered by a sf::Event, but by sf::Mouse, sf::Keyboard or sf::Joystick. The event type behind the pointer depends on the action:

How was the thor::Action constructed? Possible values for Event->Type
Keyboard/mouse/joystick actions constructed with PressOnce KeyPressed, MouseButtonPressed or JoystickButtonPressed
Keyboard/mouse/joystick actions constructed with ReleaseOnce KeyReleased, MouseButtonReleased or JoystickButtonReleased
Keyboard/mouse/joystick actions constructed with Once Any of the six event types above
Keyboard/mouse/joystick actions constructed with Realtime The pointer is NULL and thus cannot be dereferenced
Miscellaneous SFML event actions The sf::Event::EventType specified in the Action constructor
Actions combined with || and && operators Any of the operand's event types
template<typename ActionIdentifier>
sf::Window* thor::ActionContext< ActionIdentifier >::Window

Pointer to sf::Window passed to the action map.

Use this variable to access the window inside a callback function. This pointer is never NULL.


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