#include "xassetheader.h"
#include "zonefile.h"

XAssetHeader::XAssetHeader()
    : XAsset()
    , mAssetType()
    , mAssetPtr(0)
    , mZoneFile(nullptr)
{

}

XAssetHeader::XAssetHeader(ZoneFile *aZoneFile)
    : XAsset()
    , mAssetType()
    , mAssetPtr(0)
    , mZoneFile(aZoneFile)
{

}

XAssetHeader::~XAssetHeader()
{

}

void XAssetHeader::ParseData(QDataStream *aStream)
{
    quint32 rawAssetType;
    *aStream
        >> rawAssetType
        >> mAssetPtr;

    mAssetType = mZoneFile->GetType(rawAssetType);
}

void XAssetHeader::Clear()
{
    mAssetType = ASSET_TYPE_NONE;
    mAssetPtr = 0;
}

XAssetType XAssetHeader::GetAssetType() const
{
    return mAssetType;
}

qint32 XAssetHeader::GetAssetPtr() const
{
    return mAssetPtr;
}
