@Override public void parse (char[] data, int offset, int length) { debug = btParser.debugLevel > BehaviorTreeParser.DEBUG_NONE; root = null; clear(); super.parse(data, offset, length); // Pop all task from the stack and check their minimum number of children popAndCheckMinChildren(0); Subtree<E> rootTree = subtrees.get(""); if (rootTree == null) throw new RuntimeException("Missing root tree"); root = rootTree.rootTask; if (root == null) throw new RuntimeException("The tree must have at least the root task"); clear(); }
void switchToNewTree(String name) { // Pop all task from the stack and check their minimum number of children popAndCheckMinChildren(0); this.currentTree = new Subtree<E>(name); Subtree<E> oldTree = subtrees.put(name, currentTree); if (oldTree != null) throw new RuntimeException("A subtree named '" + name + "' is already defined"); }
popAndCheckMinChildren(stack.size() - i);
popAndCheckMinChildren(stack.size - i);
@Override public void parse (char[] data, int offset, int length) { debug = btParser.debugLevel > BehaviorTreeParser.DEBUG_NONE; root = null; clear(); super.parse(data, offset, length); // Pop all task from the stack and check their minimum number of children popAndCheckMinChildren(0); Subtree<E> rootTree = subtrees.get(""); if (rootTree == null) throw new GdxRuntimeException("Missing root tree"); root = rootTree.rootTask; if (root == null) throw new GdxRuntimeException("The tree must have at least the root task"); clear(); }
void switchToNewTree(String name) { // Pop all task from the stack and check their minimum number of children popAndCheckMinChildren(0); this.currentTree = new Subtree<E>(name); Subtree<E> oldTree = subtrees.put(name, currentTree); if (oldTree != null) throw new GdxRuntimeException("A subtree named '" + name + "' is already defined"); }
popAndCheckMinChildren(stack.size - i);
@Override public void parse (char[] data, int offset, int length) { debug = btParser.debugLevel > BehaviorTreeParser.DEBUG_NONE; root = null; clear(); super.parse(data, offset, length); // Pop all task from the stack and check their minimum number of children popAndCheckMinChildren(0); Subtree<E> rootTree = subtrees.get(""); if (rootTree == null) throw new GdxRuntimeException("Missing root tree"); root = rootTree.rootTask; if (root == null) throw new GdxRuntimeException("The tree must have at least the root task"); clear(); }
void switchToNewTree(String name) { // Pop all task from the stack and check their minimum number of children popAndCheckMinChildren(0); this.currentTree = new Subtree<E>(name); Subtree<E> oldTree = subtrees.put(name, currentTree); if (oldTree != null) throw new GdxRuntimeException("A subtree named '" + name + "' is already defined"); }