FiniteStateMachineT Class |
Namespace: Archon.SwissArmyLib.Automata
public class FiniteStateMachine<T>
The FiniteStateMachineT type exposes the following members.
Name | Description | |
---|---|---|
FiniteStateMachineT(T) |
Creates a new Finite State Machine.
If you need control over how the states are created, you can register them manually using RegisterState(IFsmStateT).
If not, then you can freely use ChangeStateAutoTState which will create the states using their default constructor.
| |
FiniteStateMachineT(T, IFsmStateT) |
Creates a new Finite State Machine and changes the state to startState.
If you need control over how the states are created, you can register them manually using RegisterState(IFsmStateT).
If not, then you can freely use ChangeStateAutoTState which will create the states using their default constructor.
|
Name | Description | |
---|---|---|
Context |
A shared context which all states have access to.
| |
CurrentState |
The active state.
| |
PreviousState |
The previously active state.
|
Name | Description | |
---|---|---|
ChangeStateTState |
Changes the active state to the given state type.
An instance of that type should already had been registered to use this method.
| |
ChangeStateTState(TState) |
Changes the active state to a specific state instance.
This will (if not null) also register the state.
| |
ChangeStateAutoTState |
Changes the active state to the given state type.
If a state of that type isn't already registered, it will automatically create a new instance using the empty constructor.
| |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the type of the current instance. (Inherited from Object.) | |
IsStateRegistered(Type) |
Checks whether a state type is registered.
| |
IsStateRegisteredTState |
Generic version of IsStateRegistered(Type).
Checks whether a state type is registered.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
RegisterState |
Preemptively add a state instance.
Useful if the state doesn't have an empty constructor and therefore cannot be used with ChangeStateAuto.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Update |
Call this every time the machine should update. Eg. every frame.
|