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>
|
2022-05-15 22:25:36 +00:00
|
|
|
#include <QDateTime>
|
|
|
|
#include <QVector>
|
2022-05-11 22:20:35 +00:00
|
|
|
|
|
|
|
namespace Modrinth {
|
2022-05-15 22:25:36 +00:00
|
|
|
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;
|
|
|
|
|
2022-05-15 22:25:36 +00:00
|
|
|
LoadState detailsLoaded = LoadState::NotLoaded;
|
2022-05-11 22:20:35 +00:00
|
|
|
QString wikiUrl;
|
|
|
|
QString body;
|
2022-05-15 22:25:36 +00:00
|
|
|
|
|
|
|
LoadState versionsLoaded = LoadState::NotLoaded;
|
|
|
|
QVector<Version> versions;
|
2022-05-11 22:20:35 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-05-15 22:25:36 +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)
|