Skip to main content

EngineCommandBuffer.ixx File

Concrete command buffer pre-configured with all engine command types. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

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

namespaceruntime

Runtime infrastructure for game execution and lifecycle orchestration. More...

namespaceworld

World state management, resource registry, and per-frame update context. More...

namespacemessaging

Communication infrastructure for commands and events. More...

namespacecommand

Compile-time typed command buffering and handler routing. More...

Classes Index

classEngineCommandBuffer

Concrete command buffer pre-configured with all engine command types. More...

Description

Concrete command buffer pre-configured with all engine command types.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file EngineCommandBuffer.ixx
3 * @brief Concrete command buffer pre-configured with all engine command types.
4 */
5module;
6
7#include <utility>
8#include <type_traits>
9
10export module helios.engine.runtime.messaging.command.EngineCommandBuffer;
11
12import helios.engine.mechanics.gamestate.types;
13import helios.engine.mechanics.match.types;
14
15import helios.engine.state.Bindings;
16
17import helios.engine.state.commands;
18
19import helios.engine.runtime.spawn.commands;
20
21import helios.engine.runtime.messaging.command.CommandBuffer;
22import helios.engine.runtime.messaging.command.TypedCommandBuffer;
23
24import helios.engine.modules.ui.widgets.commands;
25import helios.engine.mechanics.timing.commands;
26import helios.engine.mechanics.combat.commands;
27import helios.engine.mechanics.damage.commands;
28import helios.engine.mechanics.scoring.commands;
29import helios.engine.modules.physics.motion.commands;
30import helios.engine.mechanics.lifecycle.commands.WorldLifecycleCommand;
31
32import helios.engine.common.tags.CommandBufferRole;
33
34static_assert(requires {
37 >::Type;
38}, "Bindings not visible in EngineCommandBuffer TU");
39
40static_assert(requires {
43 >::Type;
44}, "Bindings not visible in EngineCommandBuffer TU");
45
46export namespace helios::engine::runtime::world {
47 class UpdateContext;
48 class GameWorld;
49}
50
52
54
55 /**
56 * @brief Concrete command buffer pre-configured with all engine command types.
57 *
58 * @details EngineCommandBuffer is a thin facade over a TypedCommandBuffer
59 * instantiated with the full set of command types used by the engine.
60 * It is registered as a resource in the GameWorld and wrapped by
61 * a type-erased CommandBuffer via the Concept/Model pattern.
62 * Systems access it via `UpdateContext::queueCommand<T>()`.
63 *
64 * ## Registered Command Types
65 *
66 * | Domain | Commands |
67 * |--------|----------|
68 * | Combat | `Aim2DCommand`, `ShootCommand`, `ApplyDamageCommand` |
69 * | Motion | `Move2DCommand`, `SteeringCommand` |
70 * | Scoring | `UpdateScoreCommand` |
71 * | Spawn | `ScheduledSpawnPlanCommand`, `SpawnCommand`, `DespawnCommand` |
72 * | State | `StateCommand<GameState>`, `DelayedStateCommand<GameState>`, `StateCommand<MatchState>`, `DelayedStateCommand<MatchState>` |
73 * | UI | `UiActionCommand` |
74 * | Timing | `TimerControlCommand` |
75 * | Lifecycle | `WorldLifecycleCommand` |
76 *
77 * @see TypedCommandBuffer
78 * @see CommandBuffer
79 * @see UpdateContext
80 */
82
83
84 /**
85 * @brief The underlying typed buffer with all engine command types.
86 */
91
94
96
107 >;
108
109 /**
110 * @brief The buffer implementation instance.
111 */
112 BufferImpl impl_;
113
114 public:
115
116 /**
117 * @brief Tag identifying this type as a command buffer for ResourceRegistry.
118 */
120
121 /**
122 * @brief Enqueues a command of the specified type.
123 *
124 * @tparam T The command type. Must be one of the registered command types.
125 * @tparam Args Constructor argument types.
126 *
127 * @param args Arguments forwarded to the command constructor.
128 */
129 template<class T, class... Args>
130 void add(Args&&... args) {
131 impl_.template add<T>(std::forward<Args>(args)...);
132 }
133
134
135 /**
136 * @brief Flushes all command queues via the underlying TypedCommandBuffer.
137 *
138 * @param gameWorld The game world where the commands are flushed.
139 * @param updateContext The current frame's update context.
140 */
141 void flush(GameWorld& gameWorld, UpdateContext& updateContext) noexcept {
142 impl_.flush(gameWorld, updateContext);
143 }
144
145 /**
146 * @brief Discards all queued commands without executing them.
147 */
148 void clear() noexcept {
149 impl_.clear();
150 }
151 };
152
153
154}
155

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.