Skip to main content

StateCommandDispatcher Class Template

Routes state commands to the appropriate handler. More...

Declaration

template <typename StateType> class helios::engine::state::dispatcher::StateCommandDispatcher<StateType> { ... }

Base class

classTypedWorldCommandDispatcher<T>

Type-safe dispatcher template for handling specific WorldCommand types. More...

Public Constructors Index

template <typename StateType>
StateCommandDispatcher ()=default

Protected Member Functions Index

template <typename StateType>
voiddispatchTyped (helios::engine::runtime::world::GameWorld &gameWorld, const helios::engine::state::commands::StateCommand< StateType > &command) noexcept override

Dispatches a state command to its handler. More...

Description

Routes state commands to the appropriate handler.

Implements the TypedWorldCommandDispatcher interface for StateCommand. Retrieves the registered StateCommandHandler from GameWorld and submits the command.

Template Parameters
StateType

The state enum type.

See Also

StateCommand

See Also

TypedStateCommandHandler

See Also

StateManager

Definition at line 33 of file StateCommandDispatcher.ixx.

Public Constructors

StateCommandDispatcher()

template <typename StateType>
helios::engine::state::dispatcher::StateCommandDispatcher< StateType >::StateCommandDispatcher ()
default

Definition at line 57 of file StateCommandDispatcher.ixx.

Protected Member Functions

dispatchTyped()

template <typename StateType>
void helios::engine::state::dispatcher::StateCommandDispatcher< StateType >::dispatchTyped (helios::engine::runtime::world::GameWorld & gameWorld, const helios::engine::state::commands::StateCommand< StateType > & command)
inline noexcept protected virtual

Dispatches a state command to its handler.

Parameters
gameWorld

The game world.

command

The state command to dispatch.

Definition at line 44 of file StateCommandDispatcher.ixx.

47 ) noexcept override {
48
49 if (auto* gameStateCommandHandler = gameWorld.stateCommandHandler<StateType>()) {
50 gameStateCommandHandler->submit(command);
51 }
52 };

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.