Class FSMTransition#
Defined in File FSM.h
Inheritance Relationships#
Base Type#
public Karana::Core::Base(Class Base)
Class Documentation#
-
class FSMTransition : public Karana::Core::Base#
An edge in the graph that makes up an FSM.
Public Functions
-
FSMTransition(const kc::ks_ptr<FSMState> &parent_state, const kc::ks_ptr<FSMState> &child_state, std::function<bool()> should_transition_fn)#
FSMTransition constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.
- Parameters:
parent_state – The parent FSMState of the edge.
child_state – The child FSMState of the edge.
should_transition_fn – The function that indicates whether this state should transition or not. This should return true when it is time to transition, and false when it is not. The FSM.update method checks these functions to decide when to transition.
Public Members
-
std::function<bool()> should_transition_fn#
Function that indicates if we should transition. true for yes and false for no.
-
Karana::Core::CallbackRegistry<void> on_transition_fns#
Functions that execute when transitioning on this edge.
Public Static Functions
-
static kc::ks_ptr<FSMTransition> create(const kc::ks_ptr<FSMState> &parent_state, const kc::ks_ptr<FSMState> &child_state, std::function<bool()> should_transition_fn)#
Create a new instance of FSMTransition.
- Parameters:
parent_state – The parent FSMState of the edge.
child_state – The child FSMState of the edge.
should_transition_fn – The function that indicates whether this state should transition or not. This should return true when it is time to transition, and false when it is not. The FSM.update method checks these functions to decide when to transition.
- Returns:
A pointer to the newly created instance of FSMTransition.
-
FSMTransition(const kc::ks_ptr<FSMState> &parent_state, const kc::ks_ptr<FSMState> &child_state, std::function<bool()> should_transition_fn)#