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

Function ParseSourceGame

src/openrct2/object/ObjectFactory.cpp:224–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 json_t& jRoot, const IFileDataRetriever* fileRetriever, bool loadImageTable, std::string_view path);
223
224 static ObjectSourceGame ParseSourceGame(const std::string_view s)
225 {
226 static const std::unordered_map<std::string_view, ObjectSourceGame> LookupTable{
227 { "rct1", ObjectSourceGame::rct1 },
228 { "rct1aa", ObjectSourceGame::addedAttractions },
229 { "rct1ll", ObjectSourceGame::loopyLandscapes },
230 { "rct2", ObjectSourceGame::rct2 },
231 { "rct2ww", ObjectSourceGame::wackyWorlds },
232 { "rct2tt", ObjectSourceGame::timeTwister },
233 { "official", ObjectSourceGame::openRCT2Official },
234 { "custom", ObjectSourceGame::custom },
235 };
236 auto result = LookupTable.find(s);
237 return (result != LookupTable.end()) ? result->second : ObjectSourceGame::custom;
238 }
239
240 static void ReadObjectLegacy(Object& object, IReadObjectContext* context, IStream* stream)
241 {

Callers 1

ExtractSourceGamesFunction · 0.85

Calls 2

findMethod · 0.80
endMethod · 0.65

Tested by

no test coverage detected