| 89 | } |
| 90 | |
| 91 | static 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 | |
| 110 | static bool ExportSave(MemoryStream& stream, std::unique_ptr<IContext>& context) |
| 111 | { |
no test coverage detected