Ejemplo n.º 1
0
        //~Selector()
        //{
        //}

#if BEHAVIAC_USE_HTN
        public override bool decompose(BehaviorNode node, PlannerTaskComplex seqTask, int depth, Planner planner)
        {
            Selector sel = (Selector)node;

            bool bOk        = false;
            int  childCount = sel.GetChildrenCount();
            int  i          = 0;

            for (; i < childCount; ++i)
            {
                BehaviorNode childNode = sel.GetChild(i);
                PlannerTask  childTask = planner.decomposeNode(childNode, depth);

                if (childTask != null)
                {
                    seqTask.AddChild(childTask);
                    bOk = true;
                    break;
                }
            }

            return(bOk);
        }