DoopelPonger
Public Member Functions | List of all members
AutoStateMachine< T > Class Template Reference

StateMachine that when the current state is finished it will automatically transition to the next registered state. More...

Public Member Functions

 AutoStateMachine (T defaultState, params AutoStateInformation< T >[] transitionInformation)
 
void DoAction ()
 Trigger the action corresponding to the current state. If the action returns true, then the next state is transitioned. It is important to call this method every update tick as it uses the Time.deltaTime to keep track of any timing things. This is actually bad and should be fixed so that dependencies of this class don't have to know that this should always be called. More...
 
bool ChangeState (T newState)
 

Detailed Description

StateMachine that when the current state is finished it will automatically transition to the next registered state.

StateMachine used to organize how/when specific actions should be done.

Type Constraints
T :System.IConvertible 

Constructor & Destructor Documentation

◆ AutoStateMachine()

AutoStateMachine< T >.AutoStateMachine ( defaultState,
params AutoStateInformation< T > []  transitionInformation 
)
Parameters
defaultStateFirst state after being created.
transitionInformationAll the states in the state machine with all their transitions and actions.

Member Function Documentation

◆ ChangeState()

bool AutoStateMachine< T >.ChangeState ( newState)
Parameters
newStateNew state that should be changed to.
Returns
True if the state was changed. False if the transition to the state is not allowed.

◆ DoAction()

void AutoStateMachine< T >.DoAction ( )

Trigger the action corresponding to the current state. If the action returns true, then the next state is transitioned. It is important to call this method every update tick as it uses the Time.deltaTime to keep track of any timing things. This is actually bad and should be fixed so that dependencies of this class don't have to know that this should always be called.


The documentation for this class was generated from the following file: