state_machine
Vars | |
current_state | Acts both as a ref to the current state and holds which state it will default to on init. |
---|---|
Procs | |
choose_transition | Decides which transition to walk into, to the next state. By default it chooses the first one on the list. |
evaluate | Makes the FSM enter a new state, if it can, based on it's current state, that state's transitions, and the holder's status.
Call it in the holder's process() , or whenever you need to. |
get_holder | Retrieve and validate our holder instance from the cached weakref. |
reset | Resets back to our initial state. |
set_state | Forces the FSM to switch to a specific state, no matter what. Use responsibly. |
Var Details
current_state
Acts both as a ref to the current state and holds which state it will default to on init.
Proc Details
choose_transition
Decides which transition to walk into, to the next state. By default it chooses the first one on the list.
evaluate
Makes the FSM enter a new state, if it can, based on it's current state, that state's transitions, and the holder's status.
Call it in the holder's process()
, or whenever you need to.
get_holder
Retrieve and validate our holder instance from the cached weakref.
reset
Resets back to our initial state.
set_state
Forces the FSM to switch to a specific state, no matter what. Use responsibly.