Esempio n. 1
0
        protected override ExecutingStatus OnExecuted()
        {
            if (Nodes.Count == 0)
            {
                return(ExecutingStatus.Success);
            }

            _currentNode = Nodes[_currentStep];

            var status = _currentNode.Execute();

            switch (status)
            {
            case ExecutingStatus.Success:
                _currentStep++;
                _currentNode = null;
                if (_currentStep >= Nodes.Count)
                {
                    _currentStep = 0;
                    return(ExecutingStatus.Success);
                }
                else
                {
                    return(ExecutingStatus.Running);
                }

            case ExecutingStatus.Running:
                return(ExecutingStatus.Running);

            case ExecutingStatus.Failure:
                return(ExecutingStatus.Failure);

            default:
                throw new Exception();
            }
        }
Esempio n. 2
0
 protected override ExecutingStatus OnExecuted()
 {
     Node.Execute();
     return(ExecutingStatus.Running);
 }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns>ExecutingStatus.Success</returns>
 protected override ExecutingStatus OnExecuted()
 {
     Node.Execute();
     return(ExecutingStatus.Success);
 }
Esempio n. 4
0
 /// <summary>
 ///
 /// </summary>
 /// <returns>ExecutingStatus.Failure</returns>
 protected override ExecutingStatus OnExecuted()
 {
     Node.Execute();
     return(ExecutingStatus.Failure);
 }