StateMachine<TEnum> class

A StateMachine handles the update of a state and transitions between a state and other defined states.

Inheritance

Constructors

StateMachine(List<TEnum> _enum)
Constructs a StateMachine instance with the specified list of states.

Properties

current → TEnum
Gives the TEnum value representing the current state of this StateMachine instance.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

define(TEnum state, {Node? enter, Node? update, Node? exit, bool isPartial = false}) → void
Defines the behavior of a state through Node instances.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
inherited
set({required TEnum to}) → void
Change the current state of StateMachine instance to the specified TEnum state.
toString() String
A string representation of this object.
inherited
transition({required TEnum from, required TEnum to, required Node on, EvaluationOrder order = EvaluationOrder.before}) → void
Defines a transition from a state to another state based on a condition Node instance.
update() Status
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited