Bromeon
Public Types | Public Member Functions | Related Functions
thor::Action Class Reference

Class for dynamic actions that are connected with SFML events. More...

List of all members.

Public Types

enum  ActionType { Realtime, PressOnce, ReleaseOnce, Once }
 Type for actions. More...

Public Member Functions

 Action (sf::Keyboard::Key key, ActionType action=Realtime)
 Construct key action.
 Action (sf::Mouse::Button mouseButton, ActionType action=Realtime)
 Construct mouse button action.
 Action (Joystick joystickState, ActionType action=Realtime)
 Construct joystick button action.
 Action (sf::Event::EventType eventType)
 Construct SFML event action.

Related Functions

Action thor::operator|| (const Action &lhs, const Action &rhs)
 OR operator of two actions: The resulting action is in effect if at least one of lhs and rhs is active.
Action thor::operator&& (const Action &lhs, const Action &rhs)
 AND operator of two actions: The resulting action is in effect if both lhs and rhs are active.

Detailed Description

Class for dynamic actions that are connected with SFML events.

Use this class to build complex constellations of different events (key strokes, pressed mouse buttons, etc.) and associate it with a ActionMap instance.


Member Enumeration Documentation

Type for actions.

Enumerator:
Realtime 

Repeated input (e.g. a key that is held down).

PressOnce 

Press events that occur only once (e.g. key pressed).

ReleaseOnce 

Release events that occur only once (e.g. key released).

Once 

Events that occur only once (combines PressOnce and ReleaseOnce).


Constructor & Destructor Documentation

thor::Action::Action ( sf::Keyboard::Key  key,
ActionType  action = Realtime 
) [explicit]

Construct key action.

Creates an action that is in effect when key is manipulated. The second parameter specifies whether KeyPressed events, KeyReleased events or sf::Keyboard::IsKeyPressed() act as action source.

thor::Action::Action ( sf::Mouse::Button  mouseButton,
ActionType  action = Realtime 
) [explicit]

Construct mouse button action.

Creates an action that is in effect when mouseButton is manipulated. The second parameter specifies whether MouseButtonPressed events, MouseButtonReleased events or sf::Mouse::IsButtonPressed() act as action source.

thor::Action::Action ( Joystick  joystickState,
ActionType  action = Realtime 
) [explicit]

Construct joystick button action.

Creates an action that is in effect when the joystick button stored in joystickState is manipulated. The second parameter specifies whether JoyButtonPressed events, JoyButtonReleased events or sf::Joystick::IsButtonPressed() act as action source.

thor::Action::Action ( sf::Event::EventType  eventType) [explicit]

Construct SFML event action.

Creates an action that is in effect when a SFML event of the type eventType is fired.


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