Skip to main content

EngineCommandBuffer Class

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

Declaration

class helios::engine::runtime::messaging::command::EngineCommandBuffer { ... }

Public Member Typedefs Index

usingEngineRoleTag = helios::engine::common::tags::CommandBufferRole

Tag identifying this type as a command buffer for ResourceRegistry. More...

Private Member Typedefs Index

usingBufferImpl = helios::engine::runtime::messaging::command::TypedCommandBuffer< helios::engine::mechanics::combat::commands::Aim2DCommand, helios::engine::mechanics::combat::commands::ShootCommand, helios::engine::mechanics::damage::commands::ApplyDamageCommand, helios::engine::modules::physics::motion::commands::Move2DCommand, helios::engine::modules::physics::motion::commands::SteeringCommand, helios::engine::mechanics::scoring::commands::UpdateScoreCommand, helios::engine::runtime::spawn::commands::ScheduledSpawnPlanCommand, helios::engine::runtime::spawn::commands::SpawnCommand, helios::engine::runtime::spawn::commands::DespawnCommand, helios::engine::state::commands::StateCommand< helios::engine::mechanics::gamestate::types::GameState >, helios::engine::state::commands::DelayedStateCommand< helios::engine::mechanics::gamestate::types::GameState >, helios::engine::state::commands::StateCommand< helios::engine::mechanics::match::types::MatchState >, helios::engine::state::commands::DelayedStateCommand< helios::engine::mechanics::match::types::MatchState >, helios::engine::modules::ui::widgets::commands::UiActionCommand, helios::engine::mechanics::timing::commands::TimerControlCommand, helios::engine::mechanics::lifecycle::commands::WorldLifecycleCommand >

The underlying typed buffer with all engine command types. More...

Public Member Functions Index

template <class T, class... Args>
voidadd (Args &&... args)

Enqueues a command of the specified type. More...

voidflush (GameWorld &gameWorld, UpdateContext &updateContext) noexcept

Flushes all command queues via the underlying TypedCommandBuffer. More...

voidclear () noexcept

Discards all queued commands without executing them. More...

Private Member Attributes Index

BufferImplimpl_

The buffer implementation instance. More...

Description

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

EngineCommandBuffer is a thin facade over a TypedCommandBuffer instantiated with the full set of command types used by the engine. It is registered as a resource in the GameWorld and wrapped by a type-erased CommandBuffer via the Concept/Model pattern. Systems access it via `UpdateContext::queueCommand<T>()`.

## Registered Command Types

| Domain | Commands | |--------|----------| | Combat | `Aim2DCommand`, `ShootCommand`, `ApplyDamageCommand` | | Motion | `Move2DCommand`, `SteeringCommand` | | Scoring | `UpdateScoreCommand` | | Spawn | `ScheduledSpawnPlanCommand`, `SpawnCommand`, `DespawnCommand` | | State | `StateCommand<GameState>`, `DelayedStateCommand<GameState>`, `StateCommand<MatchState>`, `DelayedStateCommand<MatchState>` | | UI | `UiActionCommand` | | Timing | `TimerControlCommand` | | Lifecycle | `WorldLifecycleCommand` |

See Also

TypedCommandBuffer

See Also

CommandBuffer

See Also

UpdateContext

Definition at line 81 of file EngineCommandBuffer.ixx.

Public Member Typedefs

EngineRoleTag

using helios::engine::runtime::messaging::command::EngineCommandBuffer::EngineRoleTag = helios::engine::common::tags::CommandBufferRole

Tag identifying this type as a command buffer for ResourceRegistry.

Definition at line 119 of file EngineCommandBuffer.ixx.

Private Member Typedefs

BufferImpl

using helios::engine::runtime::messaging::command::EngineCommandBuffer::BufferImpl = helios::engine::runtime::messaging::command::TypedCommandBuffer< helios::engine::mechanics::combat::commands::Aim2DCommand, helios::engine::mechanics::combat::commands::ShootCommand, helios::engine::mechanics::damage::commands::ApplyDamageCommand,
        helios::engine::modules::physics::motion::commands::Move2DCommand,
helios::engine::modules::physics::motion::commands::SteeringCommand,

helios::engine::mechanics::scoring::commands::UpdateScoreCommand,

helios::engine::runtime::spawn::commands::ScheduledSpawnPlanCommand,
helios::engine::runtime::spawn::commands::SpawnCommand,
helios::engine::runtime::spawn::commands::DespawnCommand,
helios::engine::state::commands::StateCommand&lt;helios::engine::mechanics::gamestate::types::GameState&gt;,
helios::engine::state::commands::DelayedStateCommand&lt;helios::engine::mechanics::gamestate::types::GameState&gt;,
helios::engine::state::commands::StateCommand&lt;helios::engine::mechanics::match::types::MatchState&gt;,
helios::engine::state::commands::DelayedStateCommand&lt;helios::engine::mechanics::match::types::MatchState&gt;,
helios::engine::modules::ui::widgets::commands::UiActionCommand,
helios::engine::mechanics::timing::commands::TimerControlCommand,
helios::engine::mechanics::lifecycle::commands::WorldLifecycleCommand
&gt;</td>

The underlying typed buffer with all engine command types.

Definition at line 87 of file EngineCommandBuffer.ixx.

Public Member Functions

add()

template <class T, class... Args>
void helios::engine::runtime::messaging::command::EngineCommandBuffer::add (Args &&... args)
inline

Enqueues a command of the specified type.

Template Parameters
T

The command type. Must be one of the registered command types.

Args

Constructor argument types.

Parameters
args

Arguments forwarded to the command constructor.

Definition at line 130 of file EngineCommandBuffer.ixx.

130 void add(Args&&... args) {
131 impl_.template add<T>(std::forward<Args>(args)...);
132 }

Reference add.

Referenced by add.

clear()

void helios::engine::runtime::messaging::command::EngineCommandBuffer::clear ()
inline noexcept

Discards all queued commands without executing them.

Definition at line 148 of file EngineCommandBuffer.ixx.

148 void clear() noexcept {
149 impl_.clear();
150 }

flush()

void helios::engine::runtime::messaging::command::EngineCommandBuffer::flush (GameWorld & gameWorld, UpdateContext & updateContext)
inline noexcept

Flushes all command queues via the underlying TypedCommandBuffer.

Parameters
gameWorld

The game world where the commands are flushed.

updateContext

The current frame's update context.

Definition at line 141 of file EngineCommandBuffer.ixx.

141 void flush(GameWorld& gameWorld, UpdateContext& updateContext) noexcept {
142 impl_.flush(gameWorld, updateContext);
143 }

Private Member Attributes

impl_

BufferImpl helios::engine::runtime::messaging::command::EngineCommandBuffer::impl_

The buffer implementation instance.

Definition at line 112 of file EngineCommandBuffer.ixx.

112 BufferImpl impl_;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.