#include "xcleaf.h"

XCLeaf::XCLeaf()
    : XAsset()
    , mFirstCollAabbIndex(0)
    , mCollAabbCount(0)
    , mBrushContents(0)
    , mTerrainContents(0)
    , mMins({0.0f, 0.0f, 0.0f})
    , mMaxs({0.0f, 0.0f, 0.0f})
    , mLeafBrushNode(0)
    , mCluster(0)
{
}

void XCLeaf::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        *aStream
            >> mFirstCollAabbIndex
            >> mCollAabbCount
            >> mBrushContents
            >> mTerrainContents
            >> mMins[0]
            >> mMins[1]
            >> mMins[2]
            >> mMaxs[0]
            >> mMaxs[1]
            >> mMaxs[2]
            >> mLeafBrushNode
            >> mCluster;
    }
}

quint16 XCLeaf::GetFirstCollAabbIndex() const {
    return mFirstCollAabbIndex;
}

void XCLeaf::SetFirstCollAabbIndex(quint16 index) {
    mFirstCollAabbIndex = index;
}

quint16 XCLeaf::GetCollAabbCount() const {
    return mCollAabbCount;
}

void XCLeaf::SetCollAabbCount(quint16 count) {
    mCollAabbCount = count;
}

int XCLeaf::GetBrushContents() const {
    return mBrushContents;
}

void XCLeaf::SetBrushContents(int contents) {
    mBrushContents = contents;
}

int XCLeaf::GetTerrainContents() const {
    return mTerrainContents;
}

void XCLeaf::SetTerrainContents(int contents) {
    mTerrainContents = contents;
}

QVector<float> XCLeaf::GetMins() const {
    return mMins;
}

void XCLeaf::SetMins(QVector<float> aMins) {
    mMins = aMins;
}

QVector<float> XCLeaf::GetMaxs() const {
    return mMaxs;
}

void XCLeaf::SetMaxs(QVector<float> aMaxs) {
    mMaxs = aMaxs;
}

int XCLeaf::GetLeafBrushNode() const {
    return mLeafBrushNode;
}

void XCLeaf::SetLeafBrushNode(int node) {
    mLeafBrushNode = node;
}

qint16 XCLeaf::GetCluster() const {
    return mCluster;
}

void XCLeaf::SetCluster(qint16 cluster) {
    mCluster = cluster;
}





