StateComponent Class Template
Stores the current state and last transition for an entity. More...
Declaration
Private Member Typedefs Index
template <typename StateType> | |
| using | StateTransitionIdType = helios::engine::state::types::StateTransitionIdType< StateType > |
Public Member Functions Index
template <typename StateType> | |
| StateType | state () const noexcept |
|
Returns the current state. More... | |
template <typename StateType> | |
| StateType | from () const noexcept |
|
Returns the source state of the last transition. More... | |
template <typename StateType> | |
| void | setStateFromTransitionContext (const helios::engine::state::types::StateTransitionContext< StateType > stateTransitionContext) noexcept |
|
Updates state from a transition context. More... | |
template <typename StateType> | |
| StateTransitionIdType | transitionId () const noexcept |
|
Returns the last transition ID. More... | |
Private Member Attributes Index
template <typename StateType> | |
| StateType | from_ = StateType::Undefined |
|
The state that was transitioned from. More... | |
template <typename StateType> | |
| StateTransitionIdType | transitionId_ = StateTransitionIdType::Undefined |
|
The last transition that occurred. More... | |
template <typename StateType> | |
| StateType | state_ = StateType::Undefined |
|
The current state. More... | |
Description
Stores the current state and last transition for an entity.
Typically attached to the session entity to track game-wide state. Updated by the StateManager during transitions.
- Template Parameters
-
StateType The state enum type.
- See Also
- See Also
StateTransitionContext
Definition at line 27 of file StateComponent.ixx.
Private Member Typedefs
StateTransitionIdType
|
Definition at line 29 of file StateComponent.ixx.
Public Member Functions
from()
| inline noexcept |
Returns the source state of the last transition.
- Returns
The state that was transitioned from.
Definition at line 62 of file StateComponent.ixx.
Referenced by helios::engine::runtime::world::Session::stateFrom.
setStateFromTransitionContext()
| inline noexcept |
Updates state from a transition context.
- Parameters
-
stateTransitionContext The completed transition context.
Definition at line 71 of file StateComponent.ixx.
state()
| inline noexcept |
Returns the current state.
- Returns
The current state value.
Definition at line 53 of file StateComponent.ixx.
Referenced by helios::engine::runtime::world::Session::state.
transitionId()
| inline noexcept |
Returns the last transition ID.
- Returns
The transition that led to the current state.
Definition at line 82 of file StateComponent.ixx.
Referenced by helios::engine::runtime::world::Session::stateTransitionId.
Private Member Attributes
from_
|
The state that was transitioned from.
Definition at line 34 of file StateComponent.ixx.
state_
|
The current state.
Definition at line 44 of file StateComponent.ixx.
transitionId_
|
The last transition that occurred.
Definition at line 39 of file StateComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.