Skip to main content

UiActionCommand.ixx File

Command for triggering UI actions. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespacemodules

Domain-specific components and systems. More...

namespaceui

User interface components and systems for game entities. More...

namespacewidgets

UI widget components and systems. More...

namespacecommands

UI action commands. More...

Classes Index

classUiActionCommand

A command that encapsulates a UI action request. More...

Description

Command for triggering UI actions.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file UiActionCommand.ixx
3 * @brief Command for triggering UI actions.
4 */
5module;
6
7#include <cassert>
8#include <optional>
9
10export module helios.engine.modules.ui.widgets.commands.UiActionCommand;
11
12import helios.engine.modules.ui.widgets.types;
13
14import helios.engine.ecs.EntityHandle;
15
16import helios.engine.modules.ui.widgets.types.ActionId;
17
18
20
21 /**
22 * @brief A command that encapsulates a UI action request.
23 *
24 * UiActionCommands are submitted when UI elements are activated
25 * (e.g., button pressed, menu item selected). They carry the source
26 * entity and the action identifier to execute.
27 *
28 * @see UiActionCommandManager
29 * @see UiActionComponent
30 */
32
33 /**
34 * @brief Handle of the entity that triggered the action.
35 */
37
38 /**
39 * @brief Identifier of the action to execute.
40 */
42
43
44 public:
45
46 /**
47 * @brief Constructs a command with source entity and action ID.
48 *
49 * @param source The entity that triggered the action.
50 * @param actionId The identifier of the action to execute.
51 */
55 source_(source), actionId_(actionId) {}
56
57
58 /**
59 * @brief Returns the source entity that triggered the action.
60 *
61 * @return The entity handle.
62 */
63 [[nodiscard]] helios::engine::ecs::EntityHandle source() const noexcept {
64 return source_;
65 }
66
67 /**
68 * @brief Returns the action identifier.
69 *
70 * @return The ActionId.
71 */
73 return actionId_;
74 }
75
76 };
77
78
79}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.