Skip to main content

GameStateInputResponseSystem Class

Responds to gamepad input and issues game state commands. More...

Declaration

class helios::engine::mechanics::gamestate::systems::GameStateInputResponseSystem { ... }

Public Member Typedefs Index

usingEngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions Index

voidupdate (helios::engine::runtime::world::UpdateContext &updateContext) noexcept

Processes input and submits state transition commands. More...

Description

Responds to gamepad input and issues game state commands.

Listens for the Start button and triggers appropriate state transitions based on the current game state (e.g., Title -> Running, Running -> Paused).

Definition at line 38 of file GameStateInputResponseSystem.ixx.

Public Member Typedefs

EngineRoleTag

using helios::engine::mechanics::gamestate::systems::GameStateInputResponseSystem::EngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions

update()

void helios::engine::mechanics::gamestate::systems::GameStateInputResponseSystem::update (helios::engine::runtime::world::UpdateContext & updateContext)
inline noexcept

Processes input and submits state transition commands.

Parameters
updateContext

The current update context.

Definition at line 51 of file GameStateInputResponseSystem.ixx.

52
53 auto gameState = updateContext.session().state<GameState>();
54
55 if (updateContext.inputSnapshot().gamepadState().isButtonPressed(GamepadInput::Start)) {
56
57 switch (gameState) {
59 updateContext.queueCommand<StateCommand<GameState>>(
61 );
62 break;
63
65 updateContext.queueCommand<StateCommand<GameState>>(
67 );
68 break;
69
70 default:
71 break;
72 }
73 }
74
75 }

References helios::engine::mechanics::gamestate::types::ReadyMatchRequest, helios::engine::mechanics::gamestate::types::Running, helios::input::types::Start, helios::engine::mechanics::gamestate::types::Title and helios::engine::mechanics::gamestate::types::TogglePause.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.