CommandManager.as

Go to the documentation of this file.
00001 
00005 import gugga.commands.CommandHistory;
00006 import gugga.common.ICommand;
00007  
00008 class gugga.commands.CommandManager extends  CommandHistory {
00009         
00010         private static var mInstance:CommandManager = undefined;
00011 //      private var mHistory:CommandHistory;
00012         
00013         private function CommandManager()
00014         {
00015 //                      mHistory = new CommandHistory();
00016         }
00017         
00018         public static function get Instance():CommandManager
00019         {
00020                 if (mInstance == undefined)
00021                 {
00022                         mInstance = new CommandManager();
00023                 }
00024                 return mInstance;
00025         }
00026         
00027         public function execute(aCmd:ICommand)
00028         {
00029                 var clone:ICommand =  aCmd.clone();
00030                 
00031                 if(clone.execute())
00032                 {
00033                         /* alternative 
00034                                 aCmd.execute();
00035                                 var clone:ICommand =  aCmd.clone();
00036                          */
00037                         add(clone);
00038                 }
00039         }
00040         
00041 }

Generated on Fri May 11 17:12:42 2007 for GuggaFramework by  doxygen 1.5.2