Class appFSM<State,​Trigger>

java.lang.Object
com.github.oxo42.stateless4j.StateMachine
name.moore.kevin.ze.game.states.appFSM<State,​Trigger>
Type Parameters:
State - machine state identified from enum
Trigger - transition between states enum

public class appFSM<State,​Trigger> extends com.github.oxo42.stateless4j.StateMachine
Provides a StateMachine<State, Trigger> to manage moving between the major States of the game and enable/disable the appropriate JME application states. On entering a new state the machine will call a function (provided in the constructor) to trigger the JME actions. In this manner the machine doesn't need to know anything about JME or its application states.
Author:
Kevin Moore <dev@kevin.moore.name>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    private static org.slf4j.Logger
     
    private com.jme3.app.state.AppStateManager
     

    Fields inherited from class com.github.oxo42.stateless4j.StateMachine

    config, stateAccessor, stateMutator, unhandledTriggerAction
  • Constructor Summary

    Constructors
    Constructor
    Description
    appFSM​(Object initialState, com.jme3.app.state.AppStateManager stateManager, Consumer<appFSM.State> f)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    Callback the function provided in the CTOR to process the new state.
    void
    writeDOTfile​(File smof)
    Write the diagnostic diagram of the state machine to the specified file.

    Methods inherited from class com.github.oxo42.stateless4j.StateMachine

    canFire, configuration, configure, fire, fire, fire, fire, fireInitialTransition, getPermittedTriggers, getState, isInState, onUnhandledTrigger, onUnhandledTrigger, publicFire, setTrace, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • stateManager

      private com.jme3.app.state.AppStateManager stateManager
    • function

      private Consumer<appFSM.State> function
  • Constructor Details

    • appFSM

      public appFSM(Object initialState, com.jme3.app.state.AppStateManager stateManager, Consumer<appFSM.State> f)
      Parameters:
      initialState -
      stateManager -
      f - caller provided function to process a new state.
  • Method Details

    • writeDOTfile

      public void writeDOTfile(File smof)
      Write the diagnostic diagram of the state machine to the specified file. If the file is invalid or empty the write doesn't happen.
      Parameters:
      smof -
    • onEntry

      private void onEntry()
      Callback the function provided in the CTOR to process the new state.