Skip to main content

MatchFlowSystem Class

Automatically advances the match through its state phases. More...

Declaration

class helios::engine::mechanics::match::systems::MatchFlowSystem { ... }

Public Member Typedefs Index

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

Public Member Functions Index

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

Processes match state and issues transition commands. More...

Private Member Attributes Index

MatchStateprevMatchState_ = MatchState::Undefined
StateTransitionIdType< MatchState >prevMatchStateTransitionId_ = StateTransitionIdType<MatchState>::Undefined

Description

Automatically advances the match through its state phases.

This system checks the current match state and issues appropriate transition commands to progress through: Undefined -> Warmup -> PlayerSpawn -> Playing.

Definition at line 42 of file MatchFlowSystem.ixx.

Public Member Typedefs

EngineRoleTag

using helios::engine::mechanics::match::systems::MatchFlowSystem::EngineRoleTag = helios::engine::common::tags::SystemRole

Public Member Functions

update()

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

Processes match state and issues transition commands.

Parameters
updateContext

The current update context.

Definition at line 57 of file MatchFlowSystem.ixx.

58
59 auto& session = updateContext.session();
60
61 const auto matchState = session.state<MatchState>();
62 auto matchStateTransitionId = session.stateTransitionId<MatchState>();
63
64 if (matchState != MatchState::Undefined && prevMatchState_ == matchState && prevMatchStateTransitionId_ == matchStateTransitionId) {
65 return;
66 }
67
68 prevMatchState_= matchState;
69 prevMatchStateTransitionId_ = matchStateTransitionId;
70
71 switch (matchState) {
72
73
75 updateContext.queueCommand<StateCommand<MatchState>>(
77 );
78 break;
79 }
80
82 updateContext.queueCommand<StateCommand<MatchState>>(
84 );
85 break;
86 }
87
89 updateContext.queueCommand<StateCommand<MatchState>>(
91 );
92 break;
93 }
94
95
96
97
98 default:
99 break;
100 }
101 }

References helios::engine::mechanics::match::types::CountdownRequest, helios::engine::mechanics::match::types::Start, helios::engine::mechanics::match::types::StartRequest, helios::engine::mechanics::match::types::Undefined, helios::engine::mechanics::match::types::Warmup and helios::engine::mechanics::match::types::WarmupRequest.

Private Member Attributes

prevMatchState_

MatchState helios::engine::mechanics::match::systems::MatchFlowSystem::prevMatchState_ = MatchState::Undefined

Definition at line 44 of file MatchFlowSystem.ixx.

44 MatchState prevMatchState_ = MatchState::Undefined;

prevMatchStateTransitionId_

StateTransitionIdType<MatchState> helios::engine::mechanics::match::systems::MatchFlowSystem::prevMatchStateTransitionId_ = StateTransitionIdType<MatchState>::Undefined

Definition at line 45 of file MatchFlowSystem.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.