mirror of https://github.com/OpenRCT2/OpenRCT2.git
Replace IS4Importer with IParkImporter
This commit is contained in:
parent
2b045ddb9b
commit
5c1f2f4c43
|
@ -16,18 +16,18 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "../common.h"
|
||||
#include "../scenario/ScenarioRepository.h"
|
||||
#include "common.h"
|
||||
#include "scenario/ScenarioRepository.h"
|
||||
|
||||
interface IStream;
|
||||
|
||||
/**
|
||||
* Interface to import RollerCoaster Tycoon 1 scenarios (*.SC4) and saved games (*.SV4).
|
||||
* Interface to import scenarios and saved games.
|
||||
*/
|
||||
interface IS4Importer
|
||||
interface IParkImporter
|
||||
{
|
||||
public:
|
||||
virtual ~IS4Importer() = default;
|
||||
virtual ~IParkImporter() = default;
|
||||
virtual void Load(const utf8 * path) abstract;
|
||||
virtual void LoadSavedGame(const utf8 * path) abstract;
|
||||
virtual void LoadScenario(const utf8 * path) abstract;
|
||||
|
@ -36,4 +36,5 @@ public:
|
|||
virtual bool GetDetails(scenario_index_entry * dst) abstract;
|
||||
};
|
||||
|
||||
IS4Importer * CreateS4Importer();
|
||||
IParkImporter * CreateS4Importer();
|
||||
IParkImporter * CreateS6Importer();
|
|
@ -19,7 +19,7 @@
|
|||
#include "../core/Exception.hpp"
|
||||
#include "../core/Guard.hpp"
|
||||
#include "../core/Path.hpp"
|
||||
#include "../rct1/S4Importer.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "CommandLine.hpp"
|
||||
|
||||
extern "C"
|
||||
|
|
|
@ -415,6 +415,7 @@
|
|||
<ClInclude Include="audio\AudioSource.h" />
|
||||
<ClInclude Include="FileClassifier.h" />
|
||||
<ClInclude Include="rct12.h" />
|
||||
<ClInclude Include="ParkImporter.h" />
|
||||
<ClInclude Include="rct12\SawyerEncoding.h" />
|
||||
<ClInclude Include="rct2\addresses.h" />
|
||||
<ClInclude Include="audio\audio.h" />
|
||||
|
@ -543,7 +544,6 @@
|
|||
<ClInclude Include="platform\platform.h" />
|
||||
<ClInclude Include="rct1.h" />
|
||||
<ClInclude Include="rct1\Tables.h" />
|
||||
<ClInclude Include="rct1\S4Importer.h" />
|
||||
<ClInclude Include="rct2.h" />
|
||||
<ClInclude Include="rct2\interop.h" />
|
||||
<ClInclude Include="rct2\S6Exporter.h" />
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include "../core/String.hpp"
|
||||
#include "../core/Util.hpp"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../scenario/ScenarioSources.h"
|
||||
#include "S4Importer.h"
|
||||
#include "Tables.h"
|
||||
|
||||
extern "C"
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class S4Importer final : public IS4Importer
|
||||
class S4Importer final : public IParkImporter
|
||||
{
|
||||
private:
|
||||
const utf8 * _s4Path = nullptr;
|
||||
|
@ -126,11 +126,11 @@ public:
|
|||
void Load(const utf8 * path) override
|
||||
{
|
||||
const utf8 * extension = Path::GetExtension(path);
|
||||
if (String::Equals(extension, ".sc4"))
|
||||
if (String::Equals(extension, ".sc4", true))
|
||||
{
|
||||
LoadScenario(path);
|
||||
}
|
||||
else if (String::Equals(extension, ".sv4"))
|
||||
else if (String::Equals(extension, ".sv4", true))
|
||||
{
|
||||
LoadSavedGame(path);
|
||||
}
|
||||
|
@ -2479,7 +2479,7 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
IS4Importer * CreateS4Importer()
|
||||
IParkImporter * CreateS4Importer()
|
||||
{
|
||||
return new S4Importer();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "../core/Path.hpp"
|
||||
#include "../core/String.hpp"
|
||||
#include "../core/Util.hpp"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../PlatformEnvironment.h"
|
||||
#include "../rct1/S4Importer.h"
|
||||
#include "../rct12/SawyerEncoding.h"
|
||||
#include "ScenarioRepository.h"
|
||||
#include "ScenarioSources.h"
|
||||
|
@ -316,7 +316,7 @@ private:
|
|||
{
|
||||
// RCT1 scenario
|
||||
bool result = false;
|
||||
IS4Importer * s4Importer = CreateS4Importer();
|
||||
IParkImporter * s4Importer = CreateS4Importer();
|
||||
try
|
||||
{
|
||||
s4Importer->LoadScenario(path.c_str());
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "../core/Math.hpp"
|
||||
#include "../core/Path.hpp"
|
||||
#include "../core/String.hpp"
|
||||
#include "../rct1/S4Importer.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../scenario/ScenarioRepository.h"
|
||||
#include "../scenario/ScenarioSources.h"
|
||||
#include "TitleSequence.h"
|
||||
|
@ -360,7 +360,7 @@ private:
|
|||
try
|
||||
{
|
||||
bool isScenario = String::Equals(extension, ".sc4", true);
|
||||
IS4Importer * s4Importer = CreateS4Importer();
|
||||
IParkImporter * s4Importer = CreateS4Importer();
|
||||
s4Importer->Load(path);
|
||||
s4Importer->Import();
|
||||
PrepareParkForPlayback(isScenario);
|
||||
|
|
Loading…
Reference in New Issue