public void RegisterCommand(int unitid, OOPCommand command)
 {
     if (!LastCommandByUnit.ContainsKey(unitid))
     {
         LastCommandByUnit.Add(unitid, command);
     }
     else
     {
         LastCommandByUnit[unitid] = command;
     }
 }
 public void RegisterCommand(int unitid, OOPCommand command)
 {
     if (!LastCommandByUnit.ContainsKey(unitid))
     {
         LastCommandByUnit.Add(unitid, command);
     }
     else
     {
         LastCommandByUnit[unitid] = command;
     }
 }
Exemplo n.º 3
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");
     }
 }
 public CommandInfo(TimeSpan datetime, OOPCommand command)
 {
     this.datetime = datetime;
     this.command = command;
 }
 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");
     }
 }
Exemplo n.º 6
0
 public CommandInfo(TimeSpan datetime, OOPCommand command)
 {
     this.datetime = datetime;
     this.command  = command;
 }