engine::ActionManager class

ActionManager decouples physical keys from logical gameplay intents.

This allows game logic to remain platform-agnostic and simplifies the implementation of rebindable controls and multi-input support.

Public static functions

static auto Get() -> ActionManager&
Returns a reference to the singleton ActionManager instance.

Public functions

void BindAction(const std::string& action_name, KeyCode key_code)
Bind a logical name to a physical input code.
auto IsStarted(const std::string& action_name) const -> bool
Returns true only on the frame the action was activated.
auto IsOngoing(const std::string& action_name) const -> bool
Returns true as long as any bound input is active.
auto IsReleased(const std::string& action_name) const -> bool
Returns true only on the frame the action was deactivated.
void Update()
Synchronizes state with InputManager.

Function documentation

static ActionManager& engine::ActionManager::Get()

Returns a reference to the singleton ActionManager instance.

Returns Reference to the ActionManager.

void engine::ActionManager::BindAction(const std::string& action_name, KeyCode key_code)

Bind a logical name to a physical input code.

Parameters
action_name The name used by game logic (e.g., "Jump")
key_code The raw key code (e.g., KeyCode::KC_SPACE)

bool engine::ActionManager::IsStarted(const std::string& action_name) const

Returns true only on the frame the action was activated.

Parameters
action_name The name of the action to check.
Returns true if the action started this frame, false otherwise.

bool engine::ActionManager::IsOngoing(const std::string& action_name) const

Returns true as long as any bound input is active.

Parameters
action_name The name of the action to check.
Returns true if the action is currently active, false otherwise.

bool engine::ActionManager::IsReleased(const std::string& action_name) const

Returns true only on the frame the action was deactivated.

Parameters
action_name The name of the action to check.
Returns true if the action was released this frame, false otherwise.

void engine::ActionManager::Update()

Synchronizes state with InputManager.

Must be called at the end of the Engine frame loop.