AgentOperandUpdateResult UpdateOperands() { if (_currentOp == null) { if (_ops.Count == 0) { return(AgentOperandUpdateResult.Success); } _currentOp = _ops.Dequeue(); _currentOp.Start(this); } var result = _currentOp.Update(this); if (result == AgentOperandUpdateResult.Failed) { Debug.Log("OP failed " + _currentOp); _currentOp = null; _ops.Clear(); return(AgentOperandUpdateResult.Failed); } if (result == AgentOperandUpdateResult.Success) { _currentOp = null; } return(AgentOperandUpdateResult.Pending); }
public void QueueOperand(IAgentOperand operand) { _ops.Enqueue(operand); }