Class StateMachine
- All Implemented Interfaces:
IUpdateable
- Direct Known Subclasses:
StateController
Represents a state machine that manages the states and transitions of an entity.
-
Field Summary
Fields inherited from interface IUpdateable
DEFAULT_UPDATE_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the current state of the state machine.voidSets a new state for the state machine.voidupdate()Updates the state machine, performing the current state's actions and handling transitions.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IUpdateable
getUpdatePriority
-
Constructor Details
-
StateMachine
public StateMachine()
-
-
Method Details
-
getCurrentState
Gets the current state of the state machine.- Returns:
- the current state
-
setState
Sets a new state for the state machine.- Parameters:
newState- the new state to be set
-
update
public void update()Updates the state machine, performing the current state's actions and handling transitions.- Specified by:
updatein interfaceIUpdateable- See Also:
-