Example #1
0
 // Try to process a Command, only BattleActionCommand can be processed in Battle
 public bool ProcessCommand(Core.Command command)
 {
     Core.BattleActionCommand actionCommand;
     try
     {
         actionCommand = (Core.BattleActionCommand)command;
     }
     catch (System.Exception)
     {
         return(false);
     }
     // TODO, need check but TRUST command in version1
     if (actionCommand.Source == GetCurrentActiveUnit())
     {
         actionCommand.Action.Act(actionCommand.Source, actionCommand.TargetUnits);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #2
0
 private void RunCommand(Core.Command cmd)
 {
     invoker.SetCommand(cmd);
     invoker.Run();
 }