Package name.moore.kevin.ze.game.states
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 enumTrigger- 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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Consumer<appFSM.State>private static org.slf4j.Loggerprivate com.jme3.app.state.AppStateManagerFields inherited from class com.github.oxo42.stateless4j.StateMachine
config, stateAccessor, stateMutator, unhandledTriggerAction -
Constructor Summary
ConstructorsConstructorDescriptionappFSM(Object initialState, com.jme3.app.state.AppStateManager stateManager, Consumer<appFSM.State> f) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidonEntry()Callback the function provided in the CTOR to process the new state.voidwriteDOTfile(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
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
stateManager
private com.jme3.app.state.AppStateManager stateManager -
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
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.
-