예제 #1
0
    public CompositeNode ChooseNewTask()
    {
        CompositeNode currNode = null;
        bool          found    = false;
        int           curPos   = GetController().GetChildList().IndexOf(GetCurrentTask());

        while (!found)
        {
            if (curPos == (GetController().GetChildList().Count - 1))
            {
                found    = true;
                currNode = null;
                break;
            }
            curPos++;
            currNode = GetController().GetChildList()[curPos];
            if (currNode.CheckCondition() == Status.Success)
            {
                found = true;
            }
        }
        return(currNode);
    }