ECSTASY
All in the name
Loading...
Searching...
No Matches
ActionListener.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_INTEGRATIONS_USER_ACTION_ACTIONLISTENER_HPP_
13#define ECSTASY_INTEGRATIONS_USER_ACTION_ACTIONLISTENER_HPP_
14
17#include <unordered_map>
18
20{
30
37
47 ActionListener(Listener pListener, Action::Id pActionId = Action::All) noexcept
48 : actionId(pActionId), listener(pListener)
49 {
50 }
51 };
52
61 template <Action::Id Target = Action::All>
71 ActionIdListener(Listener pListener) noexcept : ActionListener(pListener, Target)
72 {
73 }
74 };
75
85} // namespace ecstasy::integration::user_action
86
87#endif /* !ECSTASY_INTEGRATIONS_USER_ACTION_ACTIONLISTENER_HPP_ */
Encapsulate an index to an entity.
Definition Entity.hpp:35
Base of an ECS architecture.
Definition Registry.hpp:82
User action integration.
Definition Action.hpp:18
Describe an action changed event.
Definition Action.hpp:25
static constexpr Id All
Constant id matching any action ID.
Definition Action.hpp:30
size_t Id
Action identifier type.
Definition Action.hpp:27
Action listener component templated with the target action id.
ActionIdListener(Listener pListener) noexcept
Construct a new Action Id Listener.
Listener listener
Listener called on action detection.
ActionListener(Listener pListener, Action::Id pActionId=Action::All) noexcept
Construct a new Action Listener.
Action::Id actionId
Id of the target action.