DefaultMatchStateTransitionGuards Class
Provides default guard functions for match state transitions. More...
Declaration
Public Static Functions Index
| static bool | isPlayerActive (helios::engine::runtime::world::UpdateContext &updateContext, const StateTransitionRequest< MatchState > transitionRequest) |
|
Guard that allows transition only if the player is active. More... | |
| static bool | isPlayerInactive (helios::engine::runtime::world::UpdateContext &updateContext, const StateTransitionRequest< MatchState > transitionRequest) |
|
Guard that allows transition only if the player is inactive. More... | |
| static bool | hasLifeLeft (helios::engine::runtime::world::UpdateContext &updateContext, const StateTransitionRequest< MatchState > transitionRequest) |
|
Guard that allows transition only if the player has lives left. More... | |
| static bool | hasNoLifeLeft (helios::engine::runtime::world::UpdateContext &updateContext, const StateTransitionRequest< MatchState > transitionRequest) |
|
Guard that allows transition only if the player has no lives left. More... | |
Description
Provides default guard functions for match state transitions.
Guard functions are predicates that determine whether a state transition is allowed. They are evaluated before a transition occurs and can block it by returning false.
All guards are static functions that take an UpdateContext and a MatchStateTransitionRequest, returning true if the transition is allowed.
- See Also
MatchStateTransitionRequest
- See Also
Definition at line 39 of file DefaultMatchStateTransitionGuards.ixx.
Public Static Functions
hasLifeLeft()
| inline static |
Guard that allows transition only if the player has lives left.
- Parameters
-
updateContext The current frame's update context.
transitionRequest The requested state transition.
- Returns
True if the player entity has lives left.
Definition at line 85 of file DefaultMatchStateTransitionGuards.ixx.
References helios::engine::runtime::world::UpdateContext::find, helios::engine::mechanics::match::components::LivesComponent::lives, helios::engine::runtime::world::Session::playerEntityHandle and helios::engine::runtime::world::UpdateContext::session.
Referenced by hasNoLifeLeft.
hasNoLifeLeft()
| inline static |
Guard that allows transition only if the player has no lives left.
- Parameters
-
updateContext The current frame's update context.
transitionRequest The requested state transition.
- Returns
True if the player entity has no lives left.
- See Also
Definition at line 108 of file DefaultMatchStateTransitionGuards.ixx.
Reference hasLifeLeft.
isPlayerActive()
| inline static |
Guard that allows transition only if the player is active.
- Parameters
-
updateContext The current frame's update context.
transitionRequest The requested state transition.
- Returns
True if the player entity exists and is active.
Definition at line 51 of file DefaultMatchStateTransitionGuards.ixx.
References helios::engine::runtime::world::UpdateContext::find, helios::engine::runtime::world::Session::playerEntityHandle and helios::engine::runtime::world::UpdateContext::session.
isPlayerInactive()
| inline static |
Guard that allows transition only if the player is inactive.
- Parameters
-
updateContext The current frame's update context.
transitionRequest The requested state transition.
- Returns
True if the player entity exists and is inactive.
Definition at line 68 of file DefaultMatchStateTransitionGuards.ixx.
References helios::engine::runtime::world::UpdateContext::find, helios::engine::runtime::world::Session::playerEntityHandle and helios::engine::runtime::world::UpdateContext::session.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.