Space Station 13 - Modules - TypesVar Details - Proc Details

state_machine

Vars

current_stateActs both as a ref to the current state and holds which state it will default to on init.

Procs

choose_transitionDecides which transition to walk into, to the next state. By default it chooses the first one on the list.
evaluateMakes 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_holderRetrieve and validate our holder instance from the cached weakref.
resetResets back to our initial state.
set_stateForces 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.