Adjust the import/export code to have the game state passed

This commit is contained in:
ζeh Matt committed 2024-01-19 16:32:19 +02:00
1 parent a5dde0f8dc
commit 9b2a79faf1
17 files changed
+154 -88

No files matched your search

+9 -2
View File
@@ -9,6 +9,7 @@
#include "../Context.h"
#include "../FileClassifier.h"
#include "../GameState.h"
#include "../OpenRCT2.h"
#include "../ParkImporter.h"
#include "../common.h"
@@ -22,6 +23,8 @@
#include <memory>
using namespace OpenRCT2;
static void WriteConvertFromAndToMessage(FileExtension sourceFileType, FileExtension destinationFileType);
static u8string GetFileTypeFriendlyName(FileExtension fileType);
@@ -98,7 +101,9 @@ exitcode_t CommandLine::HandleCommandConvert(CommandLineArgEnumerator* enumerato
objManager.LoadObjects(loadResult.RequiredObjects);
importer->Import();
// TODO: Have a separate GameState and exchange once loaded.
auto& gameState = GetGameState();
importer->Import(gameState);
}
catch (const std::exception& ex)
{
@@ -120,7 +125,9 @@ exitcode_t CommandLine::HandleCommandConvert(CommandLineArgEnumerator* enumerato
// correct initial view
WindowCloseByClass(WindowClass::MainWindow);
exporter->Export(destinationPath);
auto& gameState = GetGameState();
exporter->Export(gameState, destinationPath);
}
catch (const std::exception& ex)
{