NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
c_tree.hpp
1#pragma once
2#include <types.h>
3
7class cTreeNd_c {
8public:
10 cTreeNd_c();
11
13 cTreeNd_c *getTreeNext() const;
14
17
18 cTreeNd_c *getParent() const { return mpParent; }
19 cTreeNd_c *getChild() const { return mpChild; }
20 cTreeNd_c *getBrPrev() const { return mpPrev; }
21 cTreeNd_c *getBrNext() const { return mpNext; }
22
23protected:
25 void forcedClear();
26
31
32 friend class cTreeMg_c;
33};
34
37class cTreeMg_c {
38public:
40 cTreeMg_c() : mpRootNode(nullptr) {}
41
49 bool addTreeNode(cTreeNd_c *node, cTreeNd_c *parent);
50
57 bool removeTreeNode(cTreeNd_c *node);
58
59protected:
61};
A tree container. See cTreeNd_c.
Definition c_tree.hpp:37
cTreeMg_c()
Constructs a new tree container.
Definition c_tree.hpp:40
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.
Definition c_tree.cpp:15
cTreeNd_c * mpRootNode
The root node of the tree.
Definition c_tree.hpp:60
bool removeTreeNode(cTreeNd_c *node)
Removes a node from the tree.
Definition c_tree.cpp:57
A tree node. See cTreeMg_c.
Definition c_tree.hpp:7
cTreeNd_c * mpParent
The parent node.
Definition c_tree.hpp:27
void forcedClear()
Clears all fields.
Definition c_tree.cpp:8
cTreeNd_c * mpPrev
The previous sibling node.
Definition c_tree.hpp:29
cTreeNd_c()
Constructs a new tree node.
Definition c_tree.cpp:4
cTreeNd_c * getTreeNextNotChild() const
Gets the next node in preorder traversal order, excluding the node's children.
Definition c_tree.cpp:103
cTreeNd_c * mpChild
The child node.
Definition c_tree.hpp:28
cTreeNd_c * mpNext
The next sibling node.
Definition c_tree.hpp:30
cTreeNd_c * getTreeNext() const
Gets the next node in preorder traversal order.
Definition c_tree.cpp:92