protected BTNodeBase(BTNodeBase parentNode, BTPreCondition preCondition = null) { _childNodes = new List <BTNodeBase> (); _parentNode = parentNode; _preCondition = preCondition; _isActiveNode = false; }
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]); } } }
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); } }
protected override bool DoCheck(BTInput input) { base.DoCheck(input); BTNodeBase node = _childNodes[_index]; if (node.Check(input)) { return(true); } return(base.DoCheck(input)); }
public BTControlNodeBase(BTNodeBase parentNode, BTPreCondition preCondition = null) : base(parentNode, preCondition) { }
public BTActionNodeBase(BTNodeBase parentNode, BTPreCondition preCondition = null) : base(parentNode, preCondition) { _isActiveNode = true; }
protected override void DoAddChild(BTNodeBase childNode) { base.DoAddChild(childNode); _childNodesStatus.Add(BTRunningStatus.Executing); }
public BTControlNodeParallel(BTNodeBase parentNode, BTPreCondition preCondition = null) : base(parentNode, preCondition) { _childNodesStatus = new List <BTRunningStatus> (); }
public BTNodeBase() { _childNodes = new List <BTNodeBase> (); _parentNode = null; _isActiveNode = false; }