PureMVC Architects Lounge

PureMVC Manifold => Demos and Utils => Topic started by: zjnue on December 13, 2008, 07:54:24



Title: StateMachine - A PureMVC Haxe Utility
Post by: zjnue on December 13, 2008, 07:54:24
This utility provides a simple yet effective Finite State Machine implementation, which allows the definition of discrete states, and the valid transitions to other states available from any given state, and the actions which trigger the transitions.

A mechanism is provided for defining the entire state machine in XML and having a fully populated StateMachine injected into the PureMVC app.

Standard and MultiCore versions are included.

The demo has historically been located here: http://trac.puremvc.org/Utility_Haxe_StateMachine
The project has been moved here: https://github.com/PureMVC/puremvc-haxe-util-statemachine/wiki

It was ported to Haxe by Zjnue Brzavi.


Title: Re: StateMachine - A PureMVC Haxe Utility
Post by: simon_ustwo on June 04, 2009, 08:52:09
Hi,

I've run into a small problem, when entering a state I want to have the ability to change to a new state, but because the "currentState" hasn't been set we're left in a weird state of having no state at all.

StateMachine.hx

// Enter the next State
if( nextState.entering != null ) sendNotification( nextState.entering, nextState );
currentState = nextState;

I would like to change it to:

// Enter the next State
currentState = nextState;
if( nextState.entering != null ) sendNotification( nextState.entering, nextState );


This will fix the issue I'm seeing. Note I'm using this in neko and this could be only present in this.

thoughts?


Title: Re: StateMachine - A PureMVC Haxe Utility
Post by: puremvc on June 04, 2009, 01:54:11
That would probably be because the StateMachine utility needs to be upgraded to match the current AS3 reference version. This is a problem that existed in 1.0.

Ping the author, Zjnue,  about this. There is a link to his contributor page on the Haxe StateMachine project page.

Also, Zjnue: The trunk of the AS3 version contains the latest code, which will be published as 1.2 shortly. If you upgrade follow the code in the trunk.

-=Cliff>


Title: Re: StateMachine - A PureMVC Haxe Utility
Post by: simon_ustwo on June 05, 2009, 08:24:04
Cheers, I'll let him know.


Title: Re: StateMachine - A PureMVC Haxe Utility
Post by: zjnue on June 06, 2009, 04:33:07
Hi guys,
Thanks for the ping. I can look at it a little later this weekend.
Cheers


Title: Re: StateMachine - A PureMVC Haxe Utility
Post by: zjnue on June 11, 2009, 12:30:49
Updated StateMachine trunk and tagged it as 1.2. Please see if you are happy with that Cliff.