#include "xassetlist.h"

XAssetList::XAssetList()
    : XAsset()
    , mStringList()
    , mAssetCount(0)
    , mAssets()
{
}

void XAssetList::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        // Parse string list
        mStringList.ParsePtr(aStream);

        // Parse asset count and assets
        *aStream >> mAssetCount;
        aStream->skipRawData(2 * 4);

        mStringList.ParseData(aStream);

        for (int i = 0; i < mAssetCount; i++) {
            //XAsset asset;
            //asset.ParseData(aStream);
            //mAssets.append(asset);
        }
    }
}

XScriptStringList XAssetList::GetStringList() const {
    return mStringList;
}

void XAssetList::SetStringList(const XScriptStringList& stringList) {
    mStringList = stringList;
}

int XAssetList::GetAssetCount() const {
    return mAssetCount;
}

void XAssetList::SetAssetCount(int count) {
    mAssetCount = count;
}

QVector<XAsset*> XAssetList::GetAssets() {
    return mAssets;
}

void XAssetList::SetAssets(QVector<XAsset *> assets) {
    mAssets = assets;
}


