feature/test #9
@ -1,9 +1,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef XANIMPARTTRANS_H
|
||||
#define XANIMPARTTRANS_H
|
||||
|
||||
@ -14,6 +8,7 @@ class XAnimPartTrans : public XAsset
|
||||
{
|
||||
public:
|
||||
explicit XAnimPartTrans();
|
||||
~XAnimPartTrans();
|
||||
|
||||
void ParseData(QDataStream *aStream) override;
|
||||
|
||||
|
||||
@ -1,8 +1,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef XANIMPARTTRANSDATA_H
|
||||
#define XANIMPARTTRANSDATA_H
|
||||
|
||||
@ -13,6 +8,7 @@ class XAnimPartTransData : public XAsset
|
||||
{
|
||||
public:
|
||||
explicit XAnimPartTransData();
|
||||
~XAnimPartTransData();
|
||||
|
||||
void ParseData(QDataStream *aStream) override;
|
||||
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
#ifndef XASSET_H
|
||||
#define XASSET_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QDataStream>
|
||||
|
||||
class XAsset
|
||||
{
|
||||
|
||||
public:
|
||||
XAsset();
|
||||
virtual ~XAsset();
|
||||
|
||||
@ -1,32 +1,37 @@
|
||||
|
||||
|
||||
|
||||
#include "xassetlist.h"
|
||||
|
||||
XAssetList::XAssetList()
|
||||
: XAsset() {
|
||||
: XAsset()
|
||||
, mStringList()
|
||||
, mAssetCount(0)
|
||||
, mAssets()
|
||||
{
|
||||
}
|
||||
|
||||
void XAssetList::ParseData(QDataStream *aStream) {
|
||||
if (GetPtr() == -1) {
|
||||
// Parse string list
|
||||
mStringList.ParseData(aStream);
|
||||
mStringList.ParsePtr(aStream);
|
||||
|
||||
// Parse asset count and assets
|
||||
aStream->read((char*)&mAssetCount, sizeof(int));
|
||||
for (int i = 0; i < mAssetCount; ++i) {
|
||||
XAsset asset;
|
||||
asset.ParseData(aStream);
|
||||
mAssets.append(asset);
|
||||
*aStream >> mAssetCount;
|
||||
aStream->skipRawData(2 * 4);
|
||||
|
||||
mStringList.ParseData(aStream);
|
||||
|
||||
for (int i = 0; i < mAssetCount; i++) {
|
||||
//XAsset asset;
|
||||
//asset.ParseData(aStream);
|
||||
//mAssets.append(asset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ScriptStringList& XAssetList::GetStringList() const {
|
||||
XScriptStringList XAssetList::GetStringList() const {
|
||||
return mStringList;
|
||||
}
|
||||
|
||||
void XAssetList::SetStringList(const ScriptStringList& stringList) {
|
||||
void XAssetList::SetStringList(const XScriptStringList& stringList) {
|
||||
mStringList = stringList;
|
||||
}
|
||||
|
||||
@ -38,15 +43,11 @@ void XAssetList::SetAssetCount(int count) {
|
||||
mAssetCount = count;
|
||||
}
|
||||
|
||||
QVector<XAsset>& XAssetList::GetAssets() {
|
||||
QVector<XAsset*> XAssetList::GetAssets() {
|
||||
return mAssets;
|
||||
}
|
||||
|
||||
const QVector<XAsset>& XAssetList::GetAssets() const {
|
||||
return mAssets;
|
||||
}
|
||||
|
||||
void XAssetList::SetAssets(const QVector<XAsset>& assets) {
|
||||
void XAssetList::SetAssets(QVector<XAsset *> assets) {
|
||||
mAssets = assets;
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
|
||||
|
||||
#ifndef XASSETLIST_H
|
||||
#define XASSETLIST_H
|
||||
|
||||
#include "xscriptstringlist.h"
|
||||
#include "xasset.h"
|
||||
|
||||
#include <QVector>
|
||||
#include "scriptstringlist.h"
|
||||
|
||||
class XAssetList : public XAsset
|
||||
{
|
||||
@ -14,20 +13,19 @@ public:
|
||||
|
||||
void ParseData(QDataStream *aStream) override;
|
||||
|
||||
const ScriptStringList& GetStringList() const;
|
||||
void SetStringList(const ScriptStringList& stringList);
|
||||
XScriptStringList GetStringList() const;
|
||||
void SetStringList(const XScriptStringList& stringList);
|
||||
|
||||
int GetAssetCount() const;
|
||||
void SetAssetCount(int count);
|
||||
|
||||
QVector<XAsset>& GetAssets();
|
||||
const QVector<XAsset>& GetAssets() const;
|
||||
void SetAssets(const QVector<XAsset>& assets);
|
||||
QVector<XAsset*> GetAssets();
|
||||
void SetAssets(QVector<XAsset *> assets);
|
||||
|
||||
private:
|
||||
ScriptStringList mStringList;
|
||||
XScriptStringList mStringList;
|
||||
int mAssetCount = 0;
|
||||
QVector<XAsset> mAssets;
|
||||
QVector<XAsset*> mAssets;
|
||||
};
|
||||
|
||||
#endif // XASSETLIST_H
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user