diff options
Diffstat (limited to 'launcher/modplatform/ModIndex.h')
-rw-r--r-- | launcher/modplatform/ModIndex.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h index 40f1efc4..f15b296a 100644 --- a/launcher/modplatform/ModIndex.h +++ b/launcher/modplatform/ModIndex.h @@ -23,6 +23,7 @@ #include <QString> #include <QVariant> #include <QVector> +#include <optional> class QIODevice; @@ -51,11 +52,34 @@ struct DonationData { QString url; }; +struct IndexedVersionType { + enum class Enum { + Release = 1, + Beta, + Alpha, + UNKNOWN + }; + IndexedVersionType(const QString& type); + IndexedVersionType(int type); + IndexedVersionType(const IndexedVersionType::Enum& type); + IndexedVersionType(const IndexedVersionType& type); + static const QString toString (const IndexedVersionType::Enum& type); + static const IndexedVersionType::Enum enumFromString(const QString& type); + bool isValid() const {return m_type != IndexedVersionType::Enum::UNKNOWN; } + bool operator==(const IndexedVersionType& other) const { return m_type == other.m_type; } + bool operator==(const IndexedVersionType::Enum& type) const { return m_type == type; } + bool operator<(const IndexedVersionType& other) const { return m_type < other.m_type; } + bool operator<(const IndexedVersionType::Enum& type) const { return m_type < type; } + + IndexedVersionType::Enum m_type; +}; + struct IndexedVersion { QVariant addonId; QVariant fileId; QString version; QString version_number = {}; + std::optional<IndexedVersionType> verison_type = {}; QStringList mcVersion; QString downloadUrl; QString date; |