Class StateMachine
java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.StateMachine
- All Implemented Interfaces:
IUpdateable
- Direct Known Subclasses:
StateController
Represents a state machine that manages the states and transitions of an entity.
-
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.
-
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:
-