-
Notifications
You must be signed in to change notification settings - Fork 16
StateMachine
Tommo J. Phillips edited this page Oct 22, 2023
·
2 revisions
Namespace: TommoJProductions.ModApi.StateMachine
Represents the ModAPI State Machine.
public class StateMachineInheritance Object → StateMachine
public StateMachine()Represents the update method.
public void update()Sets the current state.
public void setState(IState state)state IState
The state to set.
Exits the current state.
public void exitCurrentState()Adds a Transition to transfer from state to another.
public void addTransition(IState from, IState to, Func<bool> predicate)from IState
The state to transition from
to IState
The state to transition to
predicate Func<Boolean>
Predicate. The function that predicates whether to transition.
Adds a Global Transition to transfer to another state.
public void addGlobalTransition(IState state, Func<bool> predicate)state IState
The state to transition to
predicate Func<Boolean>
Predicate. The function that predicates whether to transition.