Class StateMachine

java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.StateMachine
All Implemented Interfaces:
IUpdateable
Direct Known Subclasses:
StateController

public class StateMachine extends Object implements IUpdateable
Represents a state machine that manages the states and transitions of an entity.
  • Constructor Details

    • StateMachine

      public StateMachine()
  • Method Details

    • getCurrentState

      public State getCurrentState()
      Gets the current state of the state machine.
      Returns:
      the current state
    • setState

      public void setState(State newState)
      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:
      update in interface IUpdateable
      See Also: