Class StateMachine<Context,State extends State<Context>>

java.lang.Object
dev.prozilla.pine.core.state.StateMachine<Context,State>
All Implemented Interfaces:
MutableStateProvider<Context,State>, StateProvider<Context,State>

public class StateMachine<Context,State extends State<Context>> extends Object implements MutableStateProvider<Context,State>
Utility class for managing a finite-state machine (FSM).
  • Field Details

  • Constructor Details

    • StateMachine

      public StateMachine(State initialState, Context context)
      Creates a state machine for a given context and enters its initial state.
      Parameters:
      initialState - The initial state of the state machine
      context - The context of the state
  • Method Details