home *** CD-ROM | disk | FTP | other *** search
- package game.controller
- {
- import game.model.GameProxy;
- import game.view.AppMediator;
- import game.view.GameMediator;
- import game.view.components.GameView;
- import org.puremvc.as3.interfaces.ICommand;
- import org.puremvc.as3.interfaces.INotification;
- import org.puremvc.as3.patterns.command.SimpleCommand;
-
- public class StartGameCommand extends SimpleCommand implements ICommand
- {
-
-
- public function StartGameCommand()
- {
- super();
- }
-
- override public function execute(note:INotification) : void
- {
- var gameProxy:GameProxy = new GameProxy();
- facade.registerProxy(gameProxy);
- var appMed:AppMediator = facade.retrieveMediator(AppMediator.NAME) as AppMediator;
- var gameView:GameView = new GameView();
- appMed.getViewContainer().addChild(gameView);
- var gameMed:GameMediator = new GameMediator(gameView);
- facade.registerMediator(gameMed);
- gameProxy.startGame();
- gameMed.initialize();
- }
- }
- }
-