Hexagon
Loading...
Searching...
No Matches
StateMachine< TParent > Class Template Reference

Public Member Functions

delegate float GetCurrentTimeDelegate ()
 
virtual void Init< TStateEnum > (Dictionary< TStateEnum, State > enum2state, List< StateNode > nodes)
 
virtual async void Update ()
 
virtual void FixedUpdate ()
 
virtual ? Transition GetNextState (Func< Transition, bool >? extraCondition=null)
 
virtual State FinishTransition ()
 
virtual void Die ()
 
 StateMachine (TParent parent)
 

Static Public Member Functions

static StateID GetID< TEnumState > (TEnumState value)
 

Public Attributes

readonly Dictionary< StateID, State_enum2state = new()
 
readonly List< StateNode_nodes = new()
 
readonly Dictionary< StateID, List< Transition > > _stateTree = new()
 
GetCurrentTimeDelegate GetCurrentTimeFunction = () => UnityEngine.Time.time
 
virtual StateID
 

Protected Member Functions

virtual ? Transition GetTransitionFromCurrent (Func< Transition, bool >? extraCondition=null)
 
virtual void BeginTransition (StateID newState, Transition transition)
 
virtual void OnStateChanged (State from, State to)
 

Protected Attributes

Transition_currentTransition = null
 

Properties

State _currentState = null! [get, protected set]
 
State_targetState = null [get, protected set]
 
State _previousState = null! [get, protected set]
 
StateID _currentStateID = 0 [get, protected set]
 
bool _isTransitioning = false [get, protected set]
 
bool _isLocked = false [get, protected set]
 
TParent Parent [get]
 

Constructor & Destructor Documentation

◆ StateMachine()

StateMachine< TParent >.StateMachine ( TParent parent)
inline

Member Function Documentation

◆ BeginTransition()

virtual void StateMachine< TParent >.BeginTransition ( StateID newState,
Transition transition )
inlineprotectedvirtual

◆ Die()

virtual void StateMachine< TParent >.Die ( )
inlinevirtual

◆ FinishTransition()

virtual State StateMachine< TParent >.FinishTransition ( )
inlinevirtual

◆ FixedUpdate()

virtual void StateMachine< TParent >.FixedUpdate ( )
inlinevirtual

◆ GetCurrentTimeDelegate()

delegate float StateMachine< TParent >.GetCurrentTimeDelegate ( )

◆ GetID< TEnumState >()

static StateID StateMachine< TParent >.GetID< TEnumState > ( TEnumState value)
inlinestatic
Type Constraints
TEnumState :Enum 

◆ GetNextState()

virtual ? Transition StateMachine< TParent >.GetNextState ( Func< Transition, bool >? extraCondition = null)
inline

◆ GetTransitionFromCurrent()

virtual ? Transition StateMachine< TParent >.GetTransitionFromCurrent ( Func< Transition, bool >? extraCondition = null)
inlineprotectedvirtual

◆ Init< TStateEnum >()

virtual void StateMachine< TParent >.Init< TStateEnum > ( Dictionary< TStateEnum, State > enum2state,
List< StateNode > nodes )
inlinevirtual
Type Constraints
TStateEnum :Enum 

◆ OnStateChanged()

virtual void StateMachine< TParent >.OnStateChanged ( State from,
State to )
inlineprotectedvirtual

◆ Update()

virtual async void StateMachine< TParent >.Update ( )
inlinevirtual

Member Data Documentation

◆ _currentTransition

Transition? StateMachine< TParent >._currentTransition = null
protected

◆ _enum2state

readonly Dictionary<StateID, State> StateMachine< TParent >._enum2state = new()

◆ _nodes

readonly List<StateNode> StateMachine< TParent >._nodes = new()

◆ _stateTree

readonly Dictionary<StateID, List<Transition> > StateMachine< TParent >._stateTree = new()

◆ GetCurrentTimeFunction

GetCurrentTimeDelegate StateMachine< TParent >.GetCurrentTimeFunction = () => UnityEngine.Time.time

◆ StateID

virtual StateMachine< TParent >.StateID

Property Documentation

◆ _currentState

State StateMachine< TParent >._currentState = null!
getprotected set

◆ _currentStateID

StateID StateMachine< TParent >._currentStateID = 0
getprotected set

◆ _isLocked

bool StateMachine< TParent >._isLocked = false
getprotected set

◆ _isTransitioning

bool StateMachine< TParent >._isTransitioning = false
getprotected set

◆ _previousState

State StateMachine< TParent >._previousState = null!
getprotected set

◆ _targetState

State? StateMachine< TParent >._targetState = null
getprotected set

◆ Parent

TParent StateMachine< TParent >.Parent
get

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