示例#1
0
 void GiveOrder(OOPCommand command)
 {
     UnitCommandCache.GetInstance().RegisterCommand(command.UnitToReceiveOrder, command);
     logfile.WriteLine("GiveOrder " + command.ToString());
     lock (recentcommands)
     {
         TimeSpan gametime = TimeHelper.GetGameTime();
         recentcommands.Add(new CommandInfo(gametime, command));
         allcommands.Add(new CommandInfo(gametime, command));
     }
     if (aicallback.GiveOrder(command.UnitToReceiveOrder, command.ToSpringCommand()) == -1)
     {
         throw new Exception("GiveOrder failed");
     }
 }
 void GiveOrder( OOPCommand command)
 {
     UnitCommandCache.GetInstance().RegisterCommand( command.UnitToReceiveOrder, command);
     logfile.WriteLine("GiveOrder " + command.ToString());
     lock (recentcommands)
     {
         TimeSpan gametime = TimeHelper.GetGameTime();
         recentcommands.Add( new CommandInfo( gametime, command) );
         allcommands.Add(new CommandInfo(gametime, command));
     }
     if (aicallback.GiveOrder(command.UnitToReceiveOrder, command.ToSpringCommand()) == -1)
     {
         throw new Exception( "GiveOrder failed");
     }
 }