2016-02-28 02:32:56 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <minecraft/VersionFile.h>
|
2016-03-07 06:31:28 +05:30
|
|
|
#include <minecraft/Library.h>
|
2016-02-28 02:32:56 +05:30
|
|
|
#include <QJsonDocument>
|
2021-04-01 07:20:28 +05:30
|
|
|
#include <ProblemProvider.h>
|
2016-02-28 02:32:56 +05:30
|
|
|
|
2016-03-03 06:10:12 +05:30
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
|
|
|
|
class MULTIMC_LOGIC_EXPORT MojangVersionFormat
|
2016-02-28 23:31:54 +05:30
|
|
|
{
|
2016-03-19 07:36:32 +05:30
|
|
|
friend class OneSixVersionFormat;
|
|
|
|
protected:
|
2018-07-15 18:21:05 +05:30
|
|
|
// does not include libraries
|
|
|
|
static void readVersionProperties(const QJsonObject& in, VersionFile* out);
|
|
|
|
// does not include libraries
|
|
|
|
static void writeVersionProperties(const VersionFile* in, QJsonObject& out);
|
2016-02-28 23:31:54 +05:30
|
|
|
public:
|
2018-07-15 18:21:05 +05:30
|
|
|
// version files / profile patches
|
|
|
|
static VersionFilePtr versionFileFromJson(const QJsonDocument &doc, const QString &filename);
|
|
|
|
static QJsonDocument versionFileToJson(const VersionFilePtr &patch);
|
2016-03-07 06:31:28 +05:30
|
|
|
|
2018-07-15 18:21:05 +05:30
|
|
|
// libraries
|
2021-04-01 07:20:28 +05:30
|
|
|
static LibraryPtr libraryFromJson(ProblemContainer & problems, const QJsonObject &libObj, const QString &filename);
|
2018-07-15 18:21:05 +05:30
|
|
|
static QJsonObject libraryToJson(Library *library);
|
2016-02-28 23:31:54 +05:30
|
|
|
};
|