#include "xcleafbrushnode.h"

XCLeafBrushNode::XCLeafBrushNode()
    : XAsset()
    , mAxis(0)
    , mLeafBrushCount(0)
    , mContents(0)
    , mData()
{
}

XCLeafBrushNode::~XCLeafBrushNode()
{

}

void XCLeafBrushNode::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        *aStream
            >> mAxis
            >> mLeafBrushCount
            >> mContents;

        // Parse data
        mData.ParseData(aStream);
    }
}

void XCLeafBrushNode::Clear()
{
    mAxis = 0;
    mLeafBrushCount = 0;
    mContents = 0;
    mData = XCLeafBrushNodeData();
}

quint8 XCLeafBrushNode::GetAxis() const {
    return mAxis;
}

void XCLeafBrushNode::SetAxis(quint8 axis) {
    mAxis = axis;
}

qint16 XCLeafBrushNode::GetLeafBrushCount() const {
    return mLeafBrushCount;
}

void XCLeafBrushNode::SetLeafBrushCount(qint16 count) {
    mLeafBrushCount = count;
}

int XCLeafBrushNode::GetContents() const {
    return mContents;
}

void XCLeafBrushNode::SetContents(int contents) {
    mContents = contents;
}

XCLeafBrushNodeData& XCLeafBrushNode::GetData() {
    return mData;
}

const XCLeafBrushNodeData& XCLeafBrushNode::GetData() const {
    return mData;
}

void XCLeafBrushNode::SetData(const XCLeafBrushNodeData& data) {
    mData = data;
}
