Method AddState
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
AddState(TLabel, Action, Action, Action)
Adds a state, and the delegates that should run when the state starts, stops, and when the state machine is updated.
Any delegate can be null, and wont be executed.
public void AddState(TLabel label, Action onStart, Action onUpdate, Action onStop)
Parameters
labelTLabelThe name of the state to add.
onStartActionThe action performed when the state is entered.
onUpdateActionThe action performed when the state machine is updated in the given state.
onStopActionThe action performed when the state machine is left.
AddState(TLabel, Action, Action)
Adds a state, and the delegates that should run when the state starts, and when the state machine is updated.
Any delegate can be null, and wont be executed.
public void AddState(TLabel label, Action onStart, Action onUpdate)
Parameters
labelTLabelThe name of the state to add.
onStartActionThe action performed when the state is entered.
onUpdateActionThe action performed when the state machine is updated in the given state.
AddState(TLabel, Action)
Adds a state, and the delegates that should run when the state starts.
Any delegate can be null, and wont be executed.
public void AddState(TLabel label, Action onStart)
Parameters
labelTLabelThe name of the state to add.
onStartActionThe action performed when the state is entered.
AddState(TLabel)
Adds a state.
public void AddState(TLabel label)
Parameters
labelTLabelThe name of the state to add.
AddState<TSubStateLabel>(TLabel, StateMachine<TSubStateLabel>, TSubStateLabel)
Adds a sub state machine for the given state.
The sub state machine need not be updated, as long as this state machine is being updated.
[Version(1, 4, 0)]
public void AddState<TSubStateLabel>(TLabel label, StateMachine<TSubStateLabel> subMachine, TSubStateLabel subMachineStartState)
Parameters
labelTLabelThe name of the state to add.
subMachineStateMachine<TSubStateLabel>The sub-machine that will run during the given state.
subMachineStartStateTSubStateLabelThe starting state of the sub-machine.
Type Parameters
TSubStateLabelThe type of the sub-machine.