UiActionCommandManager Class
Manages and processes UI action commands with policy-based dispatch. More...
Declaration
Public Member Typedefs Index
| using | EngineRoleTag = helios::engine::common::tags::ManagerRole |
Private Member Typedefs Index
| using | ActionCallback = std::function< void( helios::engine::runtime::world::UpdateContext &updateContext, const UiActionCommand &command)> |
Public Constructors Index
| UiActionCommandManager () | |
|
Constructs the manager with default capacity. More... | |
Public Member Functions Index
| void | flush (helios::engine::runtime::world::UpdateContext &update_context) noexcept |
|
Processes all pending commands by invoking their registered policies. More... | |
| bool | submit (UiActionCommand uiActionCommand) noexcept |
|
Submits a UI action command for processing. More... | |
| UiActionCommandManager & | addPolicy (const ActionId actionId, ActionCallback callback) |
|
Registers a callback for a specific action ID. More... | |
| void | init (helios::engine::runtime::world::GameWorld &gameWorld) |
|
Initializes the manager and registers it with the game world. More... | |
Private Member Attributes Index
| std::vector< UiActionCommand > | commands_ |
|
Queue of pending UI action commands. More... | |
| std::unordered_map< ActionId, ActionCallback > | policies_ |
Description
Manages and processes UI action commands with policy-based dispatch.
Collects UiActionCommand instances and dispatches them to registered action callbacks based on ActionId. Supports policy registration for handling different action types.
- See Also
- See Also
Definition at line 43 of file UiActionCommandManager.ixx.
Public Member Typedefs
EngineRoleTag
|
Definition at line 59 of file UiActionCommandManager.ixx.
Private Member Typedefs
ActionCallback
|
Definition at line 45 of file UiActionCommandManager.ixx.
Public Constructors
UiActionCommandManager()
| inline |
Constructs the manager with default capacity.
Definition at line 64 of file UiActionCommandManager.ixx.
Referenced by addPolicy.
Public Member Functions
addPolicy()
| inline |
Registers a callback for a specific action ID.
- Parameters
-
actionId The action ID to register.
callback The callback to invoke when the action is triggered.
- Returns
Reference to this manager for method chaining.
Definition at line 111 of file UiActionCommandManager.ixx.
Reference UiActionCommandManager.
flush()
| inline noexcept |
Processes all pending commands by invoking their registered policies.
- Parameters
-
gameWorld The game world.
update_context The current update context.
Definition at line 74 of file UiActionCommandManager.ixx.
init()
| inline |
Initializes the manager and registers it with the game world.
- Parameters
-
gameWorld The game world to register with.
Definition at line 126 of file UiActionCommandManager.ixx.
Reference helios::engine::runtime::world::GameWorld::registerCommandHandler.
submit()
| inline noexcept |
Submits a UI action command for processing.
- Parameters
-
uiActionCommand The command to submit.
- Returns
Always returns true.
Definition at line 96 of file UiActionCommandManager.ixx.
Private Member Attributes
commands_
|
Queue of pending UI action commands.
Definition at line 51 of file UiActionCommandManager.ixx.
policies_
|
Map from ActionId to their handling callbacks.
Definition at line 56 of file UiActionCommandManager.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.