1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

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

This commit is contained in:
ζeh Matt
2023-12-28 01:29:06 +02:00
parent a5dde0f8dc
commit 9b2a79faf1
17 changed files with 154 additions and 88 deletions

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)
{