Ejemplo n.º 1
0
 public override void SetTreeDepth(int depth)
 {
     base.SetTreeDepth(depth);
     if(child != null)
     {
         child.SetTreeDepth(depth + 1);
     }
 }
Ejemplo n.º 2
0
            public BTTree(BTTask root)
            {
                blackboard = new Blackboard();
                child = root;
                root.SetTreeDepth(0);

                BeginTree();
            }
 //adds an action as a child to this node
 public void AddTask(BTTask newAction)
 {
     for (int i = 0; i < children.Count; i++)
     {
         if (children[i].GetName() == newAction.GetName())
         {
             return;
         }
     }
     children.Add(newAction);
     newAction.SetTreeDepth(treeDepth + 1);
 }