Skip to content

jangarita/Simple-SmartFoxServer-Finite-State-Machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple SmartFoxServer Finite State Machine

This is a simple finite state machine ready for SmartFoxServer.

More info: jangarita.me (in spanish).

Usage:

See the test folder for an usage example.

//Instantiate the main FSM class
FSM fsm = new FSM();

//Add states
fsm.addState(new RedState(this));
fsm.addState(new YellowState(this));
fsm.addState(new GreenState(this));

//Set the initial state
fsm.changeState("RED");

//Start the FSM internal timer for updates
fsm.start(1, TimeUnit.SECONDS);
//Or call update manually
//fsm.update();

//Don't forget to call destroy() when the FSM is not more necessary
fsm.destroy();

A State can implements FSMState or just extends BaseState.

About

A simple finite state machine ready for SmartFoxServer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages