2022-03-02 21:35:59 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaType>
|
|
|
|
#include <QString>
|
|
|
|
#include <QVariant>
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
namespace ModPlatform {
|
|
|
|
|
2022-04-13 23:16:36 +01:00
|
|
|
enum class Provider{
|
|
|
|
MODRINTH,
|
|
|
|
FLAME
|
|
|
|
};
|
|
|
|
|
|
|
|
class ProviderCapabilities {
|
|
|
|
public:
|
|
|
|
static QString hashType(Provider p)
|
|
|
|
{
|
|
|
|
switch(p){
|
|
|
|
case Provider::MODRINTH:
|
2022-04-17 15:40:41 +01:00
|
|
|
return "sha512";
|
2022-04-13 23:16:36 +01:00
|
|
|
case Provider::FLAME:
|
|
|
|
return "murmur2";
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
2022-04-14 01:25:08 +01:00
|
|
|
static const char* providerName(Provider p)
|
2022-04-13 23:16:36 +01:00
|
|
|
{
|
|
|
|
switch(p){
|
|
|
|
case Provider::MODRINTH:
|
|
|
|
return "modrinth";
|
|
|
|
case Provider::FLAME:
|
|
|
|
return "curseforge";
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-03-02 21:35:59 +00:00
|
|
|
struct ModpackAuthor {
|
|
|
|
QString name;
|
|
|
|
QString url;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexedVersion {
|
|
|
|
QVariant addonId;
|
|
|
|
QVariant fileId;
|
|
|
|
QString version;
|
|
|
|
QVector<QString> mcVersion;
|
|
|
|
QString downloadUrl;
|
|
|
|
QString date;
|
|
|
|
QString fileName;
|
|
|
|
QVector<QString> loaders = {};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IndexedPack {
|
|
|
|
QVariant addonId;
|
2022-04-13 23:16:36 +01:00
|
|
|
Provider provider;
|
2022-03-02 21:35:59 +00:00
|
|
|
QString name;
|
|
|
|
QString description;
|
|
|
|
QList<ModpackAuthor> authors;
|
|
|
|
QString logoName;
|
|
|
|
QString logoUrl;
|
|
|
|
QString websiteUrl;
|
|
|
|
|
|
|
|
bool versionsLoaded = false;
|
|
|
|
QVector<IndexedVersion> versions;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ModPlatform
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(ModPlatform::IndexedPack)
|
2022-04-13 23:16:36 +01:00
|
|
|
Q_DECLARE_METATYPE(ModPlatform::Provider)
|