1#include <game/cLib/c_tree.hpp>
16 if (node !=
nullptr) {
19 if (parent !=
nullptr) {
25 if (currChild ==
nullptr) {
28 while (currChild->
mpNext !=
nullptr) {
29 currChild = currChild->
mpNext;
39 if (currNode !=
nullptr) {
40 while (currNode->
mpNext !=
nullptr) {
41 currNode = currNode->
mpNext;
58 if (node !=
nullptr) {
68 if (node->
mpPrev !=
nullptr) {
70 }
else if (node->
mpParent !=
nullptr) {
77 if (node->
mpNext !=
nullptr) {
95 if (child !=
nullptr) {
111 while (currParent !=
nullptr) {
112 if (currParent->
mpNext !=
nullptr) {
113 return currParent->
mpNext;
bool addTreeNode(cTreeNd_c *node, cTreeNd_c *parent)
Adds a node to the tree, either to the root node or to a specified parent node.
cTreeNd_c * mpRootNode
The root node of the tree.
bool removeTreeNode(cTreeNd_c *node)
Removes a node from the tree.
A tree node. See cTreeMg_c.
cTreeNd_c * mpParent
The parent node.
void forcedClear()
Clears all fields.
cTreeNd_c * mpPrev
The previous sibling node.
cTreeNd_c()
Constructs a new tree node.
cTreeNd_c * getTreeNextNotChild() const
Gets the next node in preorder traversal order, excluding the node's children.
cTreeNd_c * mpChild
The child node.
cTreeNd_c * mpNext
The next sibling node.
cTreeNd_c * getTreeNext() const
Gets the next node in preorder traversal order.