Exemplo n.º 1
0
 public override NodeResult Execute()
 {
     if (children.Count == 1)
     {
         Node child = children[0];
         if (child.status == Status.Success || child.status == Status.Failure)
         {
             return(NodeResult.From(child.status));
         }
         return(child.runningNodeResult);
     }
     return(NodeResult.failure);
 }
Exemplo n.º 2
0
        public override NodeResult Execute()
        {
            Node node = GetChild();

            if (node == null || limitReached)
            {
                return(NodeResult.failure);
            }
            if (node.status == Status.Success || node.status == Status.Failure)
            {
                return(NodeResult.From(node.status));
            }
            return(node.runningNodeResult);
        }
Exemplo n.º 3
0
        public override NodeResult Execute()
        {
            // Return fialure when subtree is not defined
            if (tree == null)
            {
                return(NodeResult.failure);
            }
            Node root = tree.GetRoot();

            if (root.status == Status.Success || root.status == Status.Failure)
            {
                return(NodeResult.From(root.status));
            }
            return(root.runningNodeResult);
        }
Exemplo n.º 4
0
        public override NodeResult Execute()
        {
            Node node = GetChild();

            if (node == null)
            {
                return(NodeResult.failure);
            }
            if (node.status == Status.Success || node.status == Status.Failure)
            {
                return(NodeResult.From(node.status));
            }
            if (roll > probability.Value)
            {
                return(NodeResult.failure);
            }
            return(node.runningNodeResult);
        }
Exemplo n.º 5
0
        public override NodeResult Execute()
        {
            Node node = GetChild();

            if (node == null)
            {
                return(NodeResult.failure);
            }
            if (node.status == Status.Success || node.status == Status.Failure)
            {
                return(NodeResult.From(node.status));
            }
            lastConditionCheckResult = Check();
            if (lastConditionCheckResult == false)
            {
                return(NodeResult.failure);
            }
            return(node.runningNodeResult);
        }