Class for state reactor.
More...
#include <fsm.hpp>
|
| | StateReactor ()=delete |
| |
| | StateReactor (const StateType &state_type, const std::shared_ptr< DataType > &data_to_mutate, Subject *subject) |
| | StateReactor constructor. This sets which state this reactor is for and sets the data to be mutated. More...
|
| |
| constexpr StateType | getStateType () const noexcept |
| |
| virtual void | enterState () |
| | enterState is called upon triggering of this state More...
|
| |
| virtual bool | updateState (const double delta, TransitionType &transition_type) |
| | updateState is called once per engine loop for timed updates More...
|
| |
| virtual void | leaveState () |
| | leaveState is called upon triggering of a new state from this state. More...
|
| |
| virtual StateType | react (const TransitionType transition) |
| | This function is used to set up reactions for different types of transitions for this state. More...
|
| |
template<class DataType, typename StateType, typename TransitionType>
class Events::FSM::StateReactor< DataType, StateType, TransitionType >
Class for state reactor.
- Template Parameters
-
| DataType | The type of data that will be mutated by the reactor. |
| StateType | The type of state used by the reactor and fsm. |
| TransitionType | The type of transitions used by the reactor and fsm. |
template<class DataType, typename StateType, typename TransitionType>
template<class DataType, typename StateType, typename TransitionType>
StateReactor constructor. This sets which state this reactor is for and sets the data to be mutated.
- Parameters
-
| [in] | state_type | The state type |
| [in] | data_to_mutate | The data to mutate |
| [in] | subject | The subject |
template<class DataType, typename StateType, typename TransitionType>
template<class DataType, typename StateType, typename TransitionType>
template<class DataType, typename StateType, typename TransitionType>
leaveState is called upon triggering of a new state from this state.
template<class DataType, typename StateType, typename TransitionType>
This function is used to set up reactions for different types of transitions for this state.
- Parameters
-
| [in] | transition | The transition type |
- Returns
- The new state to transition into
template<class DataType, typename StateType, typename TransitionType>
| virtual bool Events::FSM::StateReactor< DataType, StateType, TransitionType >::updateState |
( |
const double |
delta, |
|
|
TransitionType & |
transition_type |
|
) |
| |
|
inlinevirtual |
updateState is called once per engine loop for timed updates
- Parameters
-
| [in] | delta | The frame delta |
| transition_type | An optional output transition type |
- Returns
- True if a new transition is provided, false otherwise
template<class DataType, typename StateType, typename TransitionType>
template<class DataType, typename StateType, typename TransitionType>
template<class DataType, typename StateType, typename TransitionType>
The documentation for this class was generated from the following file: