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
A StateMachine manages states and transition to model conditional behaviour.
  • Constructor Details

    • StateMachine

      public StateMachine()
  • Method Details

    • getCurrentState

      public State getCurrentState()
      Get the current state of the StateMachine.
      Returns:
      The current state.
    • setState

      public void setState(State newState)
      Set the new state for the StateMachine.
      Parameters:
      newState - The new state to set.
    • update

      public void update()
      Description copied from interface: IUpdateable
      This 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 the ClientConfiguration.
      Specified by:
      update in interface IUpdateable
      See Also: