Created
June 11, 2012 11:06
-
-
Save neilmanuell/2909606 to your computer and use it in GitHub Desktop.
FSM Declaration with Strings vs enmubs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// state names | |
public static const LOADING:StateName = new StateName("loading"); | |
public static const DECODING:StateName = new StateName("decoding"); | |
public static const DISPLAYING:StateName = new StateName ("displaying"); | |
// process names | |
public static const IN:ProcessName = new ProcessName("in"); | |
// state declaration | |
fsmConfig.configureState( LOADING ) | |
.withTransitionTargets( DECODING ); | |
fsmConfig.configureState( DECODING ) | |
.withTransitionTargets( DISPLAYING ); | |
fsmConfig.configureState( DISPLAYING ) | |
.withTransitionTargets( LOADING ); | |
// process declaration | |
fsmConfig.configureProcess( IN ) | |
.ifCurrentState( DISPLAYING ) | |
.transitionTo( LOADING, DECODING, DISPLAYING ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// state names | |
public static const LOADING:String = "state/loading"; | |
public static const DECODING:String = "state/decoding"; | |
public static const = "state/displaying"; | |
// process names | |
public static const IN= "process/in"; | |
// state declaration | |
fsmConfig.configureState( LOADING ) | |
.withTransitionTargets( DECODING ); | |
fsmConfig.configureState( DECODING ) | |
.withTransitionTargets( DISPLAYING ); | |
fsmConfig.configureState( DISPLAYING ) | |
.withTransitionTargets( LOADING ); | |
// process declaration | |
fsmConfig.configureProcess( IN ) | |
.ifCurrentState( DISPLAYING ) | |
.transitionTo( LOADING, DECODING, DISPLAYING ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment