Hexagon
|
Universal state machine implementaion. see State machine notes for more information. More...
Public Member Functions | |
delegate float | GetCurrentTimeDelegate () |
virtual void | Init< TStateEnum > (Dictionary< TStateEnum, State > enum2state) |
virtual void | AddTransition (Transition transition) |
void | AddTransitions (IEnumerable< Transition > transitions) |
void | AddTransitions (params TransitionGroup[] inputs) |
virtual async void | Update () |
virtual void | FixedUpdate () |
virtual ? Transition | GetNextState (Func< Transition, bool >? extraCondition=null) |
virtual State | FinishTransition () |
virtual void | Die () |
void | PushEvent (ExternalMachineEvent @event) |
ExternalMachineEvent? | PeekEvent () |
StateMachine (TParent parent) | |
Static Public Member Functions | |
static StateID | EnumToID< TEnumState > (TEnumState value) |
static TEnumState | IDToEnum< TEnumState > (StateID id) |
Public Attributes | |
readonly Dictionary< StateID, State > | _enum2state = new() |
readonly List< Transition > | _transitions = new() |
readonly Dictionary< StateID, List< Transition > > | _stateTree = new() |
Mapping of states to all their outgoing transitions. | |
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 | OnTransitionEnded (State from, State to) |
virtual void | OnTransitionStarted (State from, State to) |
Protected Attributes | |
Transition? | _currentTransition = null |
Queue< ExternalMachineEvent > | _eventQueue = new() |
Properties | |
State | _currentState = null! [get, protected set] |
State? | _targetState = null [get, protected set] |
Target state of the ongoing transition if it exists, null otherwise. | |
State | _previousState = null! [get, protected set] |
Previous state of the last transition, it is NOT nullified after exiting transition. | |
StateID | _currentStateID = 0 [get, protected set] |
bool | _isTransitioning = false [get, protected set] |
bool | _isLocked = false [get, protected set] |
bool | _hasTransitionJustStarted = false [get, protected set] |
Whether the transition was started in the last call of Update (in the last frame). | |
TParent | Parent [get] |
Events | |
Action< State, State >? | OnTransitionStartedEvent |
Action< State, State >? | OnTransitionEndedEvent |
Universal state machine implementaion. see State machine notes for more information.
TParent | : | class |
|
inline |
|
inlinevirtual |
|
inline |
|
inline |
|
inlineprotectedvirtual |
|
inlinevirtual |
|
inlinestatic |
TEnumState | : | Enum |
|
inlinevirtual |
|
inlinevirtual |
delegate float Hexagon.StateMachine.StateMachine< TParent >.GetCurrentTimeDelegate | ( | ) |
|
inline |
|
inlineprotectedvirtual |
|
inlinestatic |
TEnumState | : | Enum |
|
inlinevirtual |
TStateEnum | : | Enum |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inline |
|
inline |
|
inlinevirtual |
|
protected |
readonly Dictionary<StateID, State> Hexagon.StateMachine.StateMachine< TParent >._enum2state = new() |
|
protected |
readonly Dictionary<StateID, List<Transition> > Hexagon.StateMachine.StateMachine< TParent >._stateTree = new() |
Mapping of states to all their outgoing transitions.
readonly List<Transition> Hexagon.StateMachine.StateMachine< TParent >._transitions = new() |
GetCurrentTimeDelegate Hexagon.StateMachine.StateMachine< TParent >.GetCurrentTimeFunction = () => UnityEngine.Time.time |
virtual Hexagon.StateMachine.StateMachine< TParent >.StateID |
|
getprotected set |
|
getprotected set |
|
getprotected set |
Whether the transition was started in the last call of Update (in the last frame).
|
getprotected set |
|
getprotected set |
|
getprotected set |
Previous state of the last transition, it is NOT nullified after exiting transition.
|
getprotected set |
Target state of the ongoing transition if it exists, null otherwise.
|
get |
Action<State, State>? Hexagon.StateMachine.StateMachine< TParent >.OnTransitionEndedEvent |
Action<State, State>? Hexagon.StateMachine.StateMachine< TParent >.OnTransitionStartedEvent |