29 #ifndef THOR_ACTIONMAP_HPP
30 #define THOR_ACTIONMAP_HPP
34 #include <Thor/Input/Detail/ActionOperations.hpp>
36 #include <Aurora/Tools/NonCopyable.hpp>
37 #include <Aurora/Tools/ForEach.hpp>
45 template <
typename Event,
typename EventId>
59 template <
typename ActionId>
100 void update(sf::Window& window);
137 bool isActive(
const ActionId&
id)
const;
165 void invokeCallbacks(CallbackSystem& system, sf::Window* window)
const;
171 typedef std::map<ActionId, Action> Map;
178 detail::EventBuffer mEventBuffer;
185 #include <Thor/Input/Detail/ActionMap.inl>
186 #endif // THOR_ACTIONMAP_HPP
Class for dynamic actions that are connected with SFML events.
Definition: Action.hpp:56
Class for object-oriented handling of user-defined events.
Definition: ActionMap.hpp:46
Action & operator[](const ActionId &id)
Returns the action associated with a given action identifier.
Class template that associates identifiers with dynamic actions.
Definition: ActionMap.hpp:60
void clearEvents()
Removes the events that have been temporarily stored.
ActionMap()
Default constructor.
Definition: AnimationMap.hpp:42
ActionMap & operator=(ActionMap &&source)
Move assignment operator.
bool isActive(const ActionId &id) const
Returns whether the action associated with the specified identifier is currently in effect...
Class template thor::ActionContext.
void clearActions()
Removes all actions associated with this map.
void update(sf::Window &window)
Clears old events and polls the window for new ones.
EventSystem< ActionContext< ActionId >, ActionId > CallbackSystem
EventSystem to connect ActionMap with event listeners.
Definition: ActionMap.hpp:67
void removeAction(const ActionId &id)
Remove the action associated with the specified id.
void invokeCallbacks(CallbackSystem &system, sf::Window *window) const
Forwards active actions to a callback system.
void pushEvent(const sf::Event &event)
Feeds the action map with a SFML event, that can be used during the current frame.