XPlor/libs/xassets/xpathnodetreeinfo.cpp
2025-09-10 21:58:26 -04:00

55 lines
1.0 KiB
C++

#include "xpathnodetreeinfo.h"
#include "xpathnodetree.h"
XPathNodeTreeInfo::XPathNodeTreeInfo()
: XAsset()
, mChildren()
, mNodes()
{
SetName("Path Node Tree Info");
}
XPathNodeTreeInfo::~XPathNodeTreeInfo()
{
}
void XPathNodeTreeInfo::ParseData(XDataStream *aStream) {
if (GetPtr() == -1) {
// We'll assume we're parsing as children by default
for (int i = 0; i < 2; ++i) {
qint32 treePtr;
*aStream >> treePtr;
if (treePtr == -1)
{
}
}
}
}
XPathNodeTree *XPathNodeTreeInfo::GetChild(int index) const {
if (index >= 0 && index < 2) {
return mChildren[index];
}
return nullptr;
}
void XPathNodeTreeInfo::SetChild(int index, XPathNodeTree *child) {
if (index >= 0 && index < 2) {
mChildren[index] = child;
}
}
const XPathNodeTreeNodes& XPathNodeTreeInfo::GetNodes() const {
return mNodes;
}
void XPathNodeTreeInfo::SetNodes(const XPathNodeTreeNodes& nodes) {
mNodes = nodes;
}