MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ImportPark

Function ImportPark

test/tests/S6ImportExportTests.cpp:91–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91static bool ImportPark(MemoryStream& stream, std::unique_ptr<IContext>& context, bool retainSpatialIndices)
92{
93 stream.SetPosition(0);
94
95 auto& objManager = context->GetObjectManager();
96
97 auto importer = ParkImporter::CreateParkFile(context->GetObjectRepository());
98 auto loadResult = importer->LoadFromStream(&stream, false);
99 objManager.LoadObjects(loadResult.RequiredObjects);
100
101 // TODO: Have a separate GameState and exchange once loaded.
102 auto& gameState = getGameState();
103 importer->Import(gameState);
104
105 GameInit(retainSpatialIndices);
106
107 return true;
108}
109
110static bool ExportSave(MemoryStream& stream, std::unique_ptr<IContext>& context)
111{

Callers 1

TESTFunction · 0.85

Calls 5

GameInitFunction · 0.85
LoadObjectsMethod · 0.80
SetPositionMethod · 0.45
LoadFromStreamMethod · 0.45
ImportMethod · 0.45

Tested by

no test coverage detected