Ejemplo n.º 1
0
 protected BTNodeBase(BTNodeBase parentNode, BTPreCondition preCondition = null)
 {
     _childNodes   = new List <BTNodeBase> ();
     _parentNode   = parentNode;
     _preCondition = preCondition;
     _isActiveNode = false;
 }
Ejemplo n.º 2
0
 public void AddNodes(params BTNodeBase[] nodes)
 {
     _root = nodes[0];
     if (nodes.Length > 1)
     {
         for (int i = 1; i < nodes.Length; i++)
         {
             _root.AddChild(nodes[i]);
         }
     }
 }
Ejemplo n.º 3
0
 void SetNodeRuntimeState(BTNodeBase runtimeNode)
 {
     if (runtimeNode == null)
     {
         return;
     }
     SetNodeRuntimeState(runtimeNode.NodeId, runtimeNode.State);
     for (int i = 0; i < runtimeNode.ChildLength; i++)
     {
         BTNodeBase child = runtimeNode.ChildAt(i);
         SetNodeRuntimeState(child);
     }
 }
Ejemplo n.º 4
0
    protected override bool DoCheck(BTInput input)
    {
        base.DoCheck(input);

        BTNodeBase node = _childNodes[_index];

        if (node.Check(input))
        {
            return(true);
        }

        return(base.DoCheck(input));
    }
Ejemplo n.º 5
0
 public BTControlNodeBase(BTNodeBase parentNode, BTPreCondition preCondition = null) : base(parentNode, preCondition)
 {
 }
Ejemplo n.º 6
0
 public BTActionNodeBase(BTNodeBase parentNode, BTPreCondition preCondition = null) : base(parentNode, preCondition)
 {
     _isActiveNode = true;
 }
Ejemplo n.º 7
0
 protected override void DoAddChild(BTNodeBase childNode)
 {
     base.DoAddChild(childNode);
     _childNodesStatus.Add(BTRunningStatus.Executing);
 }
Ejemplo n.º 8
0
 public BTControlNodeParallel(BTNodeBase parentNode, BTPreCondition preCondition = null) : base(parentNode, preCondition)
 {
     _childNodesStatus = new List <BTRunningStatus> ();
 }
Ejemplo n.º 9
0
 public BTNodeBase()
 {
     _childNodes   = new List <BTNodeBase> ();
     _parentNode   = null;
     _isActiveNode = false;
 }