Class StateMachine
java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.StateMachine
- All Implemented Interfaces:
IUpdateable
- Direct Known Subclasses:
StateController
A StateMachine manages states and transition to model conditional behaviour.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the current state of the StateMachine.voidSet the new state for the StateMachine.voidupdate()This method is called by the game loop on all objects that are attached to the loop.
-
Constructor Details
-
StateMachine
public StateMachine()
-
-
Method Details
-
getCurrentState
Get the current state of the StateMachine.- Returns:
- The current state.
-
setState
Set the new state for the StateMachine.- Parameters:
newState- The new state to set.
-
update
public void update()Description copied from interface:IUpdateableThis method is called by the game loop on all objects that are attached to the loop. It's called on every tick of the loop and the frequency can be configured using theClientConfiguration.- Specified by:
updatein interfaceIUpdateable- See Also:
-