home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / Beez.swf / scripts / game / controller / StartGameCommand.as < prev    next >
Encoding:
Text File  |  2008-09-03  |  1.1 KB  |  34 lines

  1. package game.controller
  2. {
  3.    import game.model.GameProxy;
  4.    import game.view.AppMediator;
  5.    import game.view.GameMediator;
  6.    import game.view.components.GameView;
  7.    import org.puremvc.as3.interfaces.ICommand;
  8.    import org.puremvc.as3.interfaces.INotification;
  9.    import org.puremvc.as3.patterns.command.SimpleCommand;
  10.    
  11.    public class StartGameCommand extends SimpleCommand implements ICommand
  12.    {
  13.        
  14.       
  15.       public function StartGameCommand()
  16.       {
  17.          super();
  18.       }
  19.       
  20.       override public function execute(note:INotification) : void
  21.       {
  22.          var gameProxy:GameProxy = new GameProxy();
  23.          facade.registerProxy(gameProxy);
  24.          var appMed:AppMediator = facade.retrieveMediator(AppMediator.NAME) as AppMediator;
  25.          var gameView:GameView = new GameView();
  26.          appMed.getViewContainer().addChild(gameView);
  27.          var gameMed:GameMediator = new GameMediator(gameView);
  28.          facade.registerMediator(gameMed);
  29.          gameProxy.startGame();
  30.          gameMed.initialize();
  31.       }
  32.    }
  33. }
  34.