2022-05-10 23:57:47 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
/*
|
|
|
|
* PolyMC - Minecraft Launcher
|
|
|
|
* Copyright (c) 2022 flowln <flowlnlnln@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2022-03-02 21:35:59 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include <QMetaType>
|
|
|
|
#include <QString>
|
|
|
|
#include <QVariant>
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
namespace ModPlatform {
|
|
|
|
|
2022-04-21 19:45:20 +01:00
|
|
|
enum class Provider {
|
2022-04-13 23:16:36 +01:00
|
|
|
MODRINTH,
|
|
|
|
FLAME
|
|
|
|
};
|
|
|
|
|
|
|
|
class ProviderCapabilities {
|
|
|
|
public:
|
2022-04-20 01:10:12 +01:00
|
|
|
auto name(Provider) -> const char*;
|
2022-05-06 16:42:01 +01:00
|
|
|
auto readableName(Provider) -> QString;
|
|
|
|
auto hashType(Provider) -> QStringList;
|
|
|
|
auto hash(Provider, QByteArray&, QString type = "") -> QByteArray;
|
2022-04-13 23:16:36 +01:00
|
|
|
};
|
|
|
|
|
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 = {};
|
2022-05-06 16:42:01 +01:00
|
|
|
QString hash_type;
|
2022-04-21 19:45:20 +01:00
|
|
|
QString hash;
|
2022-03-02 21:35:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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)
|