//~Sequence() //{ //} #if BEHAVIAC_USE_HTN public override bool decompose(BehaviorNode node, PlannerTaskComplex seqTask, int depth, Planner planner) { Sequence sequence = (Sequence)node; bool bOk = false; int childCount = sequence.GetChildrenCount(); int i = 0; for (; i < childCount; ++i) { BehaviorNode childNode = sequence.GetChild(i); PlannerTask childTask = planner.decomposeNode(childNode, depth); if (childTask == null) { break; } //clear the log cache so that the next node can log all properites LogManager.Instance.PLanningClearCache(); seqTask.AddChild(childTask); } if (i == childCount) { bOk = true; } return(bOk); }