pollymc/launcher/modplatform/ModIndex.h
flow e17b6804a7
fix: implement PR suggestions
Some stylistic changes, and get hashes from the mod providers when
building the metadata.
2022-05-23 14:43:09 -03:00

57 lines
1016 B
C++

#pragma once
#include <QList>
#include <QMetaType>
#include <QString>
#include <QVariant>
#include <QVector>
namespace ModPlatform {
enum class Provider {
MODRINTH,
FLAME
};
class ProviderCapabilities {
public:
auto name(Provider) -> const char*;
auto hashType(Provider) -> QString;
};
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 = {};
QString hash;
};
struct IndexedPack {
QVariant addonId;
Provider provider;
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)
Q_DECLARE_METATYPE(ModPlatform::Provider)