DefaultMatchStateTransitionGuards.ixx File
Default guard functions for match state transitions. More...
Included Headers
#include <helios.engine.mechanics.match.components.LivesComponent>
#include <helios.engine.state.types>
#include <helios.engine.state.Bindings>
#include <helios.engine.mechanics.match.types>
#include <helios.engine.runtime.world.GameWorld>
#include <helios.engine.runtime.world.Session>
#include <helios.engine.runtime.world.UpdateContext>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | mechanics |
|
High-level gameplay systems and components for game logic. More... | |
| namespace | match |
|
Match state management for the helios engine. More... | |
| namespace | rules |
|
Transition rules for the match state machine. More... | |
| namespace | guards |
Classes Index
| class | DefaultMatchStateTransitionGuards |
|
Provides default guard functions for match state transitions. More... | |
Description
Default guard functions for match state transitions.
File Listing
The file content with the documentation metadata removed is:
20using namespace helios::engine::mechanics::match::types;
21using namespace helios::engine::state::types;
22using namespace helios::engine::mechanics::match::components;
24export namespace helios::engine::mechanics::match::rules::guards {
39 class DefaultMatchStateTransitionGuards {
51 static bool isPlayerActive(
52 helios::engine::runtime::world::UpdateContext& updateContext,
53 const StateTransitionRequest<MatchState> transitionRequest
55 auto playerOpt = updateContext.find(updateContext.session().playerEntityHandle());
68 static bool isPlayerInactive(
69 helios::engine::runtime::world::UpdateContext& updateContext,
70 const StateTransitionRequest<MatchState> transitionRequest
72 auto playerOpt = updateContext.find(updateContext.session().playerEntityHandle());
85 static bool hasLifeLeft(
86 helios::engine::runtime::world::UpdateContext& updateContext,
87 const StateTransitionRequest<MatchState> transitionRequest
89 auto playerOpt = updateContext.find(updateContext.session().playerEntityHandle());
93 auto* lc = playerOpt->get<LivesComponent>();
94 return lc && lc->lives() > 0;
108 static bool hasNoLifeLeft(
109 helios::engine::runtime::world::UpdateContext& updateContext,
110 const StateTransitionRequest<MatchState> transitionRequest
112 return !hasLifeLeft(updateContext, transitionRequest);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.