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
label
TLabelThe name of the state to add.
onStart
ActionThe action performed when the state is entered.
onUpdate
ActionThe action performed when the state machine is updated in the given state.
onStop
ActionThe 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
label
TLabelThe name of the state to add.
onStart
ActionThe action performed when the state is entered.
onUpdate
ActionThe 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
label
TLabelThe name of the state to add.
onStart
ActionThe action performed when the state is entered.
AddState(TLabel)
Adds a state.
public void AddState(TLabel label)
Parameters
label
TLabelThe 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
label
TLabelThe name of the state to add.
subMachine
StateMachine<TSubStateLabel>The sub-machine that will run during the given state.
subMachineStartState
TSubStateLabelThe starting state of the sub-machine.
Type Parameters
TSubStateLabel
The type of the sub-machine.