Isle
|
[AI] Represents a node within a general, N-ary tree structure. More...
#include <legotree.h>
Public Member Functions | |
LegoTreeNode () | |
[AI] Constructs an empty tree node with no children or data. [AI] More... | |
virtual | ~LegoTreeNode () |
[AI] Destructor cleans up node data and children recursively. [AI] More... | |
LegoTreeNodeData * | GetData () |
[AI] Returns the data payload stored at this node (may be nullptr). [AI] More... | |
void | SetData (LegoTreeNodeData *p_data) |
[AI] Associates a data payload with this node. More... | |
LegoU32 | GetNumChildren () |
[AI] Returns the number of direct children of this node. [AI] More... | |
void | SetNumChildren (LegoU32 p_numChildren) |
[AI] Sets the number of children for this node (does not resize pointer array). More... | |
LegoTreeNode * | GetChild (LegoU32 p_i) |
[AI] Gets the child node at the specified index (no bounds checking). More... | |
void | SetChild (LegoU32 p_i, LegoTreeNode *p_child) |
[AI] Assigns a child node pointer at the specified index in this node's children array. More... | |
LegoTreeNode ** | GetChildren () |
[AI] Returns the pointer to the children array. [AI] More... | |
void | SetChildren (LegoTreeNode **p_children) |
[AI] Assigns the entire children pointer array. More... | |
Protected Attributes | |
LegoTreeNodeData * | m_data |
[AI] Pointer to node data payload, owned by node. nullptr indicates no data present. [AI] More... | |
LegoU32 | m_numChildren |
[AI] Number of valid child pointers in m_children. [AI] More... | |
LegoTreeNode ** | m_children |
[AI] Pointer to array of tree node children (size = m_numChildren). nullptr if no children allocated. [AI] More... | |
[AI] Represents a node within a general, N-ary tree structure.
[AI]
[AI] Each node holds a pointer to a data object, a list of child nodes, and tracks the number of children. Intended for constructing arbitrarily nested tree data structures, loaded/saved recursively. [AI] Size: 0x10 bytes [AI]
Definition at line 44 of file legotree.h.
LegoTreeNode::LegoTreeNode | ( | ) |
[AI] Constructs an empty tree node with no children or data. [AI]
Definition at line 12 of file legotree.cpp.
|
virtual |
[AI] Destructor cleans up node data and children recursively. [AI]
Definition at line 21 of file legotree.cpp.
|
inline |
[AI] Gets the child node at the specified index (no bounds checking).
[AI]
p_i | Child index. [AI] |
Definition at line 72 of file legotree.h.
|
inline |
[AI] Returns the pointer to the children array. [AI]
Definition at line 81 of file legotree.h.
|
inline |
[AI] Returns the data payload stored at this node (may be nullptr). [AI]
Definition at line 54 of file legotree.h.
|
inline |
[AI] Returns the number of direct children of this node. [AI]
Definition at line 63 of file legotree.h.
|
inline |
[AI] Assigns a child node pointer at the specified index in this node's children array.
[AI]
p_i | Array index to set. [AI] |
p_child | Pointer to child tree node. [AI] |
Definition at line 77 of file legotree.h.
|
inline |
[AI] Assigns the entire children pointer array.
[AI]
p_children | Pointer to an array of LegoTreeNode* (must be heap-allocated). [AI] |
Definition at line 86 of file legotree.h.
|
inline |
[AI] Associates a data payload with this node.
[AI]
p_data | Pointer to heap-allocated payload data, takes ownership. [AI] |
Definition at line 59 of file legotree.h.
|
inline |
[AI] Sets the number of children for this node (does not resize pointer array).
[AI]
p_numChildren | New number of children. [AI] |
Definition at line 68 of file legotree.h.
|
protected |
[AI] Pointer to array of tree node children (size = m_numChildren). nullptr if no children allocated. [AI]
Definition at line 95 of file legotree.h.
|
protected |
[AI] Pointer to node data payload, owned by node. nullptr indicates no data present. [AI]
Definition at line 93 of file legotree.h.
|
protected |
[AI] Number of valid child pointers in m_children. [AI]
Definition at line 94 of file legotree.h.