Skip to main content

StateComponent.ixx File

Component storing current state for an entity. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine
namespacestate
namespacecomponents

Classes Index

classStateComponent<StateType>

Stores the current state and last transition for an entity. More...

Description

Component storing current state for an entity.

File Listing

The file content with the documentation metadata removed is:

1
5module;
6
7export module helios.engine.state.components.StateComponent;
8
9import helios.engine.state.types.StateTransitionId;
10import helios.engine.state.types.StateTransitionContext;
11
12
14
26 template<typename StateType>
28
30
34 StateType from_ = StateType::Undefined;
35
39 StateTransitionIdType transitionId_ = StateTransitionIdType::Undefined;
40
44 StateType state_ = StateType::Undefined;
45
46 public:
47
53 StateType state() const noexcept {
54 return state_;
55 }
56
62 StateType from() const noexcept {
63 return from_;
64 }
65
72 from_ = stateTransitionContext.from();
73 state_ = stateTransitionContext.to();
74 transitionId_ = stateTransitionContext.transitionId();
75 }
76
82 StateTransitionIdType transitionId() const noexcept {
83 return transitionId_;
84 }
85
86 };
87
88
89}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.