aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/flame/FlameModIndex.h
blob: 0293bb23053650fb626e123bbe81b193a16a14ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Created by timoreo on 16/01/2022.
//

#pragma once
#include <QList>
#include <QMetaType>
#include <QString>
#include <QVector>
#include <QNetworkAccessManager>
#include <QObjectPtr.h>
#include "net/NetJob.h"
#include "BaseInstance.h"

namespace FlameMod {
    struct ModpackAuthor {
        QString name;
        QString url;
    };

    struct IndexedVersion {
        int addonId;
        int fileId;
        QString version;
        QVector<QString> mcVersion;
        QString downloadUrl;
        QString date;
        QString fileName;
    };

    struct IndexedPack
    {
        int addonId;
        QString name;
        QString description;
        QList<ModpackAuthor> authors;
        QString logoName;
        QString logoUrl;
        QString websiteUrl;

        bool versionsLoaded = false;
        QVector<IndexedVersion> versions;
    };

    void loadIndexedPack(IndexedPack & m, QJsonObject & obj);
    void loadIndexedPackVersions(IndexedPack &pack, QJsonArray &arr, const shared_qobject_ptr<QNetworkAccessManager> &network, BaseInstance *inst);

}

Q_DECLARE_METATYPE(FlameMod::IndexedPack)