This file contains hidden or 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
package { | |
public class PlayingCard { | |
public static const SIX_OF_CLUBS:PlayingCard = new PlayingCard( "clubs", 6); | |
public static const JACK_OF_HEARTS:PlayingCard = new PlayingCard( "hearts", 11); | |
private var _index:int; | |
private var _suit:String; | |
public function PlayingCard(suit:String, index:int) { |
This file contains hidden or 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
<!-- Root declaration unchanged --> | |
<fsm initial="starting"> | |
<!-- | |
State declaration with unique name. | |
The phase signal attribute declarations have been migrated to child elements. | |
--> | |
<state name="starting"> | |
<!-- Declaration for enteringGuard signal --> | |
<enteringGuard> | |
<!-- |
This file contains hidden or 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
<flex-config xmlns="http://www.adobe.com/2006/flex-config"> | |
<target-player>9.0.124</target-player> | |
<compiler> | |
<debug>true</debug> | |
<source-path> | |
<path-element>src</path-element> | |
</source-path> | |
<library-path append="true"> | |
</library-path> | |
<external-library-path> |
This file contains hidden or 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
//////////////////////////////////////////// | |
// exiting guard | |
if( !lock.isKeyValid( user ) ){ | |
fsm.cancel( Reasons.KEY_INVALID ); | |
} | |
//////////////////////////////////////////// | |
//////////////////////////////////////////// | |
// cancelled | |
if( reason == Reasons.KEY_INVALID ){ |
This file contains hidden or 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
[Inject(name="lockDoor")] | |
public var lockDoor:IActionable; | |
public function onClick( event:MouseEvent ):void{ | |
lockDoor.action() | |
} |
This file contains hidden or 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
injector.mapClass( IFSMProperties, FSMProperties ) |
This file contains hidden or 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
public class LockDoor extends BaseMacroAction | |
{ | |
override protected function initiateMacroAction( payload:Object ):void | |
{ | |
sendAction( ActionNames.CLOSE); | |
sendAction( ActionNames.LOCK, payload ); | |
} | |
} |
This file contains hidden or 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
public interface IActionable | |
{ | |
function action( payload:Object = null ):void | |
} |
This file contains hidden or 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
public class BaseMacroAction implements IActionable | |
{ | |
private var _fsmController:IFSMController; | |
[Inject] | |
public function set fsmController( value:IFSMController ):void | |
{ | |
_fsmController = value; | |
} |
This file contains hidden or 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
import org.osflash.statemachine.core.IFSMController; | |
public class FSMProperties implements IFSMProperties | |
{ | |
private var _fsmController:IFSMController; | |
[Inject] | |
public function set fsmController( value:IFSMController ):void | |
{ |