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; } } } })); }
public void ThinkOnce() { ObservedActor.ScanNewObjects(2, ObservedActor.SightRange, false); CurrentAction = GetNextAction(); Actor.CurrentAction = new AbortableAction(CurrentAction, this); }
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; } } } }); }
public AbortableAction(BotAction action, SimAborter thinker) : base(action.ToString()) { Act = action; Aborter = thinker; }