Skip to content

StateMachine

Tommo J. Phillips edited this page Oct 22, 2023 · 2 revisions

StateMachine

Namespace: TommoJProductions.ModApi.StateMachine

Represents the ModAPI State Machine.

public class StateMachine

Inheritance ObjectStateMachine

Constructors

StateMachine()

public StateMachine()

Methods

update()

Represents the update method.

public void update()

setState(IState)

Sets the current state.

public void setState(IState state)

Parameters

state IState
The state to set.

exitCurrentState()

Exits the current state.

public void exitCurrentState()

addTransition(IState, IState, Func<Boolean>)

Adds a Transition to transfer from state to another.

public void addTransition(IState from, IState to, Func<bool> predicate)

Parameters

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.

addGlobalTransition(IState, Func<Boolean>)

Adds a Global Transition to transfer to another state.

public void addGlobalTransition(IState state, Func<bool> predicate)

Parameters

state IState
The state to transition to

predicate Func<Boolean>
Predicate. The function that predicates whether to transition.

Clone this wiki locally