MultiMC5/launcher/ui/pages/modplatform/modrinth/ModrinthData.h

67 lines
1.1 KiB
C
Raw Normal View History

2022-05-11 22:20:35 +00:00
/*
* Copyright 2022 kb1000
*
* This source is subject to the Microsoft Permissive License (MS-PL).
* Please see the COPYING.md file for more information.
*/
#pragma once
#include <QString>
#include <QMetaType>
#include <QUrl>
#include <QDateTime>
#include <QVector>
2022-05-11 22:20:35 +00:00
namespace Modrinth {
enum class LoadState {
NotLoaded = 0,
Loaded = 1,
Errored = 2
};
enum class VersionType {
Alpha,
Beta,
Release,
Unknown
};
struct Download {
bool valid = false;
QString filename;
QString url;
QString sha1;
uint64_t size = 0;
bool primary = false;
};
struct Version {
QString name;
Download download;
QDateTime released;
VersionType type = VersionType::Unknown;
bool featured = false;
};
2022-05-11 22:20:35 +00:00
struct Modpack {
QString id;
QString name;
QUrl iconUrl;
QString author;
QString description;
LoadState detailsLoaded = LoadState::NotLoaded;
2022-05-11 22:20:35 +00:00
QString wikiUrl;
QString body;
LoadState versionsLoaded = LoadState::NotLoaded;
QVector<Version> versions;
2022-05-11 22:20:35 +00:00
};
}
Q_DECLARE_METATYPE(Modrinth::Download)
Q_DECLARE_METATYPE(Modrinth::Version)
2022-05-11 22:20:35 +00:00
Q_DECLARE_METATYPE(Modrinth::Modpack)