2025-08-14 17:30:25 -04:00
|
|
|
#ifndef XASSET_H
|
|
|
|
|
#define XASSET_H
|
|
|
|
|
|
2025-09-05 18:35:17 -04:00
|
|
|
#include "xassettype.h"
|
2025-09-10 21:56:08 -04:00
|
|
|
#include "xdatastream.h"
|
2025-12-19 23:06:03 -05:00
|
|
|
#include "xcommoninfo.h"
|
|
|
|
|
|
2025-09-05 18:35:17 -04:00
|
|
|
#include <QString>
|
2025-09-07 12:36:08 -04:00
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QIODevice>
|
2025-08-14 17:30:25 -04:00
|
|
|
|
2025-12-19 23:06:03 -05:00
|
|
|
class ZoneFile;
|
|
|
|
|
|
2025-08-14 17:30:25 -04:00
|
|
|
class XAsset
|
|
|
|
|
{
|
|
|
|
|
public:
|
2025-12-19 23:06:03 -05:00
|
|
|
explicit XAsset();
|
2025-09-10 21:56:08 -04:00
|
|
|
virtual ~XAsset() = default;
|
2025-08-14 17:30:25 -04:00
|
|
|
|
|
|
|
|
void SetPtr(qint32 aPtr);
|
2025-09-05 18:35:17 -04:00
|
|
|
qint32 GetPtr() const;
|
|
|
|
|
|
|
|
|
|
void SetType(XAssetType aType);
|
|
|
|
|
XAssetType GetType() const;
|
|
|
|
|
|
|
|
|
|
void SetName(QString aName);
|
|
|
|
|
QString GetName() const;
|
2025-08-14 17:30:25 -04:00
|
|
|
|
2025-09-07 12:36:08 -04:00
|
|
|
static void SetDebug(bool aDebug);
|
|
|
|
|
bool IsDebug() const;
|
|
|
|
|
|
2025-08-14 17:30:25 -04:00
|
|
|
virtual void Clear();
|
2025-09-10 21:56:08 -04:00
|
|
|
virtual void ParsePtr(XDataStream *aStream, bool aDataFlag = true);
|
|
|
|
|
virtual void ParseData(XDataStream *aStream) = 0;
|
2025-12-19 23:06:03 -05:00
|
|
|
virtual void ParseDataSafe(XDataStream *aStream);
|
2025-08-14 17:30:25 -04:00
|
|
|
|
2025-09-05 18:35:17 -04:00
|
|
|
static XAsset* Create(XAssetType aAssetType);
|
|
|
|
|
static QString XAssetTypeToString(XAssetType type);
|
|
|
|
|
|
2025-09-07 12:36:08 -04:00
|
|
|
static bool mDebug;
|
|
|
|
|
|
2025-12-19 23:06:03 -05:00
|
|
|
const XCommonInfo *GetCommonInfo() const;
|
|
|
|
|
void SetCommonInfo(const XCommonInfo *newCommonInfo);
|
|
|
|
|
|
|
|
|
|
QString DisplayName() const;
|
|
|
|
|
void SetDisplayName(const QString &aDisplayName);
|
|
|
|
|
|
|
|
|
|
QVector<XAsset *> SubAssets() const;
|
|
|
|
|
void SetSubAssets(const QVector<XAsset *> &aSubAssets);
|
|
|
|
|
void AddSubAsset(XAsset *aSubAsset);
|
|
|
|
|
|
2025-08-14 17:30:25 -04:00
|
|
|
private:
|
|
|
|
|
qint32 mPtr;
|
2025-09-05 18:35:17 -04:00
|
|
|
XAssetType mType;
|
|
|
|
|
QString mName;
|
2025-12-19 23:06:03 -05:00
|
|
|
QString mDisplayName;
|
|
|
|
|
|
|
|
|
|
const XCommonInfo* mCommonInfo;
|
|
|
|
|
|
|
|
|
|
QVector<XAsset*> mSubAssets;
|
2025-08-14 17:30:25 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // XASSET_H
|