#include "xcbrushside.h"

XCBrushSide::XCBrushSide()
    : XAsset()
    , mPlane()
    , mMaterialNum(0)
    , mFirstAdjacentSideOffset(0)
    , mEdgeCount(0)
{
    
}

XCBrushSide::~XCBrushSide()
{
    
}

void XCBrushSide::ParseData(QDataStream *aStream)
{
    mPlane.ParsePtr(aStream, false);

    *aStream
        >> mMaterialNum
        >> mFirstAdjacentSideOffset
        >> mEdgeCount;

    aStream->skipRawData(1);

    if (mPlane.GetPtr() == -1)
    {
        mPlane.ParseData(aStream);
    }
}

void XCBrushSide::Clear()
{
    mPlane.Clear();
    mMaterialNum = 0;
    mFirstAdjacentSideOffset = 0;
    mEdgeCount = 0;
}
