summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/VersionFile.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-05-09 17:16:25 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:30 +0200
commit9860d5ee12acde8f7893848dac53f59ea66da281 (patch)
tree966e1d9ba1bbb1d4303bfc742faaaccd0957de8f /logic/minecraft/VersionFile.h
parent8a3a0f5a529a95c7511436051b63887dff158c50 (diff)
downloadMultiMC-9860d5ee12acde8f7893848dac53f59ea66da281.tar
MultiMC-9860d5ee12acde8f7893848dac53f59ea66da281.tar.gz
MultiMC-9860d5ee12acde8f7893848dac53f59ea66da281.tar.lz
MultiMC-9860d5ee12acde8f7893848dac53f59ea66da281.tar.xz
MultiMC-9860d5ee12acde8f7893848dac53f59ea66da281.zip
Introducing VersionPatch base class for version files and minecraft versions
Diffstat (limited to 'logic/minecraft/VersionFile.h')
-rw-r--r--logic/minecraft/VersionFile.h63
1 files changed, 11 insertions, 52 deletions
diff --git a/logic/minecraft/VersionFile.h b/logic/minecraft/VersionFile.h
index 8234445b..82b16913 100644
--- a/logic/minecraft/VersionFile.h
+++ b/logic/minecraft/VersionFile.h
@@ -5,10 +5,14 @@
#include <memory>
#include "logic/minecraft/OpSys.h"
#include "logic/minecraft/OneSixRule.h"
+#include "VersionPatch.h"
#include "MMCError.h"
+#include "RawLibrary.h"
+#include "JarMod.h"
class VersionFinal;
+
class VersionBuildError : public MMCError
{
public:
@@ -46,66 +50,19 @@ public:
virtual ~MinecraftVersionMismatch() noexcept {}
};
-struct RawLibrary;
-typedef std::shared_ptr<RawLibrary> RawLibraryPtr;
-struct RawLibrary
-{
- QString name;
- QString url;
- QString hint;
- QString absoluteUrl;
- bool applyExcludes = false;
- QStringList excludes;
- bool applyNatives = false;
- QList<QPair<OpSys, QString>> natives;
- bool applyRules = false;
- QList<std::shared_ptr<Rule>> rules;
-
- // user for '+' libraries
- enum InsertType
- {
- Apply,
- Append,
- Prepend,
- Replace
- };
- InsertType insertType = Append;
- QString insertData;
- enum DependType
- {
- Soft,
- Hard
- };
- DependType dependType = Soft;
-
- static RawLibraryPtr fromJson(const QJsonObject &libObj, const QString &filename);
-};
-
-struct Jarmod;
-typedef std::shared_ptr<Jarmod> JarmodPtr;
-struct Jarmod
-{
- QString name;
- QString baseurl;
- QString hint;
- QString absoluteUrl;
-
- static JarmodPtr fromJson(const QJsonObject &libObj, const QString &filename);
-};
-
struct VersionFile;
typedef std::shared_ptr<VersionFile> VersionFilePtr;
-struct VersionFile
+class VersionFile : public VersionPatch
{
public: /* methods */
static VersionFilePtr fromJson(const QJsonDocument &doc, const QString &filename,
const bool requireOrder, const bool isFTB = false);
static OneSixLibraryPtr createLibrary(RawLibraryPtr lib);
- int findLibrary(QList<OneSixLibraryPtr> haystack, const QString &needle);
- void applyTo(VersionFinal *version);
- bool isVanilla();
- bool hasJarMods();
+ virtual void applyTo(VersionFinal *version) override;
+ virtual bool isVanilla() override;
+ virtual bool hasJarMods() override;
+
public: /* data */
int order = 0;
QString name;
@@ -143,3 +100,5 @@ public: /* data */
QList<JarmodPtr> jarMods;
};
+
+