hxfsm 1.0.0

Simple Finite State Machine

Released 2017-12-11.

To install, run:

haxelib install hxfsm 1.0.0

See using Haxelib in Haxelib documentation for more information.

Maintainerleo.bergman
Websitehttps://github.com/lbergman/hxfsm
Current version1.0.0
StatisticsInstalled 76 times
LicenseMIT
Tags

README.md

HxFSM

Simple FSM for Haxe. Contains example OpenFL project using CallbackIntegration, but is made to be framework independent. Included is a CommandIntegration for use with mmvc.

Usage:

// Setup FSM with CallbackIntegration
var fsm:FSM = new FSM(new CallbackIntegration());
var fsmController:FSMController = new FSMController(fsm);

// Add states with transitions
// For example, InitState can go to WelcomeState or ErrorState.
fsm.add(InitState, [WelcomeState, ErrorState]);

// Access the fsmController to make transitions or query current state name
fsmController.goto(InitState);
fsmController.goto(WelcomeState);
trace("Current state:"+fsmController.currentStateName);