#ifndef XASSET_H
#define XASSET_H

#include "xassettype.h"

#include "xdatastream.h"
#include <QString>
#include <QDebug>
#include <QIODevice>

class XAsset
{
public:
    XAsset();
    virtual ~XAsset() = default;

    void SetPtr(qint32 aPtr);
    qint32 GetPtr() const;

    void SetType(XAssetType aType);
    XAssetType GetType() const;

    void SetName(QString aName);
    QString GetName() const;

    static void SetDebug(bool aDebug);
    bool IsDebug() const;

    virtual void Clear();
    virtual void ParsePtr(XDataStream *aStream, bool aDataFlag = true);
    virtual void ParseData(XDataStream *aStream) = 0;

    static XAsset* Create(XAssetType aAssetType);
    static QString XAssetTypeToString(XAssetType type);

    static bool mDebug;

private:
    qint32 mPtr;
    XAssetType mType;
    QString mName;
};

#endif // XASSET_H
