private Thread makeActionThread(BotAction value)
 {
     return(new Thread(() =>
     {
         try
         {
             value.InvokeReal();
         }
         catch (Exception e)
         {
             Debug("InvokeReal: " + e);
             //throw e;
         }
         finally
         {
             //lock (actionLock)
             {
                 if (_currentAction == value)
                 {
                     LastAction = value;
                     _currentAction = null;
                 }
             }
         }
     }));
 }
示例#2
0
 public void ThinkOnce()
 {
     ObservedActor.ScanNewObjects(2, ObservedActor.SightRange, false);
     CurrentAction = GetNextAction();
     Actor.CurrentAction = new AbortableAction(CurrentAction, this);
 }
示例#3
0
        private Thread makeActionThread(BotAction value)
        {
            return new Thread(() =>
                                  {
                                      try
                                      {
                                          value.InvokeReal();
                                      }
                                      catch (Exception e)
                                      {
                                          Debug("InvokeReal: " + e);
                                          //throw e;
                                      }
                                      finally
                                      {
                                          //lock (actionLock)
                                          {
                                              if (_currentAction == value)
                                              {
                                                  LastAction = value;
                                                  _currentAction = null;
                                              }
                                          }
                                      }
                                  });

        }
示例#4
0
 public AbortableAction(BotAction action, SimAborter thinker)
     : base(action.ToString())
 {
     Act = action;
     Aborter = thinker;
 }