#include "xcleafbrushnodedata.h"

XCLeafBrushNodeData::XCLeafBrushNodeData()
    : XAsset()
    , mLeaf()
    , mChildren()
{
}

XCLeafBrushNodeData::~XCLeafBrushNodeData()
{
    
}

void XCLeafBrushNodeData::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        // We need to determine which part of the union to parse
        // For simplicity, we'll assume it's always leaf for now
        mLeaf.ParseData(aStream);
    }
}

void XCLeafBrushNodeData::Clear()
{
    mLeaf.Clear();
    mChildren.Clear();
}

const XCLeafBrushNodeLeaf& XCLeafBrushNodeData::GetLeaf() const {
    return mLeaf;
}

void XCLeafBrushNodeData::SetLeaf(const XCLeafBrushNodeLeaf& leaf) {
    mLeaf = leaf;
}

const XCLeafBrushNodeChildren& XCLeafBrushNodeData::GetChildren() const {
    return mChildren;
}

void XCLeafBrushNodeData::SetChildren(const XCLeafBrushNodeChildren& children) {
    mChildren = children;
}
