Consume pop capacity + evade AI boiler plate

This commit is contained in:
2024-01-23 21:43:58 +01:00
parent 07d1852fb9
commit 0423a962df
14 changed files with 125 additions and 28 deletions

View File

@@ -123,6 +123,17 @@ void bzBTDestroyRoot(BzObjectPool *nodePool, BzBTNode *node) {
bzObjectPoolRelease(nodePool, node);
}
void bzBTSubTree(BzBTNode *tree, BzBTNode *parent) {
// Subtree must not have siblings
BZ_ASSERT(tree->prev == NULL && tree->next == NULL);
if (parent && parent->last) {
parent->last->next = tree;
parent->last = tree;
} else if (parent) {
parent->first = tree;
parent->last = tree;
}
}
BzBTNode *bzBTCompSelector(BzObjectPool *nodePool, BzBTNode *parent) {
return bzBTNodeMake(nodePool, parent, BZ_BT_COMP_SELECTOR);

View File

@@ -86,6 +86,8 @@ BzBTNode *bzBTMakeRoot(BzObjectPool *nodePool);
*/
void bzBTDestroyRoot(BzObjectPool *nodePool, BzBTNode *node);
void bzBTSubTree(BzBTNode *tree, BzBTNode *parent);
/**
* @brief Execute all children in turn until one fails.
*