diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-04-23 02:27:40 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-09 01:38:29 +0200 |
commit | aade36860c373268857ca821c14a13f38c880b1a (patch) | |
tree | 464b804216c7eadc00941daa33a1713c8071a088 /logic/InstanceFactory.cpp | |
parent | 3a0cdf2d3dde6192694ca34429ab277608357c2a (diff) | |
download | MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar.gz MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar.lz MultiMC-aade36860c373268857ca821c14a13f38c880b1a.tar.xz MultiMC-aade36860c373268857ca821c14a13f38c880b1a.zip |
Begin the transformation!
Nuke all the things.
Diffstat (limited to 'logic/InstanceFactory.cpp')
-rw-r--r-- | logic/InstanceFactory.cpp | 52 |
1 files changed, 9 insertions, 43 deletions
diff --git a/logic/InstanceFactory.cpp b/logic/InstanceFactory.cpp index 95fd855b..955a3f5b 100644 --- a/logic/InstanceFactory.cpp +++ b/logic/InstanceFactory.cpp @@ -23,7 +23,6 @@ #include "LegacyFTBInstance.h" #include "OneSixInstance.h" #include "OneSixFTBInstance.h" -#include "NostalgiaInstance.h" #include "OneSixInstance.h" #include "BaseVersion.h" #include "MinecraftVersion.h" @@ -51,7 +50,7 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(InstancePtr &inst, QString inst_type = m_settings->get("InstanceType").toString(); // FIXME: replace with a map lookup, where instance classes register their types - if (inst_type == "OneSix") + if (inst_type == "OneSix" || inst_type == "Nostalgia") { inst.reset(new OneSixInstance(instDir, m_settings, this)); } @@ -59,10 +58,6 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(InstancePtr &inst, { inst.reset(new LegacyInstance(instDir, m_settings, this)); } - else if (inst_type == "Nostalgia") - { - inst.reset(new NostalgiaInstance(instDir, m_settings, this)); - } else if (inst_type == "LegacyFTB") { inst.reset(new LegacyFTBInstance(instDir, m_settings, this)); @@ -98,55 +93,26 @@ InstanceFactory::InstCreateError InstanceFactory::createInstance(InstancePtr &in if (type == NormalInst) { - switch (mcVer->type) - { - case MinecraftVersion::Legacy: - // TODO new instance type - m_settings->set("InstanceType", "Legacy"); - inst.reset(new LegacyInstance(instDir, m_settings, this)); - inst->setIntendedVersionId(version->descriptor()); - inst->setShouldUseCustomBaseJar(false); - break; - case MinecraftVersion::OneSix: - m_settings->set("InstanceType", "OneSix"); - inst.reset(new OneSixInstance(instDir, m_settings, this)); - inst->setIntendedVersionId(version->descriptor()); - inst->setShouldUseCustomBaseJar(false); - break; - case MinecraftVersion::Nostalgia: - m_settings->set("InstanceType", "Nostalgia"); - inst.reset(new NostalgiaInstance(instDir, m_settings, this)); - inst->setIntendedVersionId(version->descriptor()); - inst->setShouldUseCustomBaseJar(false); - break; - default: - { - delete m_settings; - return InstanceFactory::NoSuchVersion; - } - } + m_settings->set("InstanceType", "OneSix"); + inst.reset(new OneSixInstance(instDir, m_settings, this)); + inst->setIntendedVersionId(version->descriptor()); + inst->setShouldUseCustomBaseJar(false); } else if (type == FTBInstance) { - switch (mcVer->type) + if(mcVer->usesLegacyLauncher()) { - case MinecraftVersion::Legacy: m_settings->set("InstanceType", "LegacyFTB"); inst.reset(new LegacyFTBInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); - break; - case MinecraftVersion::OneSix: + } + else + { m_settings->set("InstanceType", "OneSixFTB"); inst.reset(new OneSixFTBInstance(instDir, m_settings, this)); inst->setIntendedVersionId(version->descriptor()); inst->setShouldUseCustomBaseJar(false); - break; - default: - { - delete m_settings; - return InstanceFactory::NoSuchVersion; - } } } else |