コード例 #1
0
        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);
        }
コード例 #2
0
 public void QueueOperand(IAgentOperand operand)
 {
     _ops.Enqueue(operand);
 }