54 lines
1.0 KiB
C++
54 lines
1.0 KiB
C++
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#include "xassetlist.h"
|
||
|
|
|
||
|
|
XAssetList::XAssetList()
|
||
|
|
: XAsset() {
|
||
|
|
}
|
||
|
|
|
||
|
|
void XAssetList::ParseData(QDataStream *aStream) {
|
||
|
|
if (GetPtr() == -1) {
|
||
|
|
// Parse string list
|
||
|
|
mStringList.ParseData(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);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const ScriptStringList& XAssetList::GetStringList() const {
|
||
|
|
return mStringList;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XAssetList::SetStringList(const ScriptStringList& stringList) {
|
||
|
|
mStringList = stringList;
|
||
|
|
}
|
||
|
|
|
||
|
|
int XAssetList::GetAssetCount() const {
|
||
|
|
return mAssetCount;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XAssetList::SetAssetCount(int count) {
|
||
|
|
mAssetCount = count;
|
||
|
|
}
|
||
|
|
|
||
|
|
QVector<XAsset>& XAssetList::GetAssets() {
|
||
|
|
return mAssets;
|
||
|
|
}
|
||
|
|
|
||
|
|
const QVector<XAsset>& XAssetList::GetAssets() const {
|
||
|
|
return mAssets;
|
||
|
|
}
|
||
|
|
|
||
|
|
void XAssetList::SetAssets(const QVector<XAsset>& assets) {
|
||
|
|
mAssets = assets;
|
||
|
|
}
|
||
|
|
|
||
|
|
|