MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / findScenario

Function findScenario

src/OpenLoco/src/Scenario/ScenarioManager.cpp:277–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275 }
276
277 static std::optional<uint32_t> findScenario(const fs::path& fileName)
278 {
279 const auto u8FileName = fileName.filename().u8string();
280 auto res = std::ranges::find_if(_scenarioList, [&u8FileName](const ScenarioIndexEntry& entry) {
281 return std::strcmp(entry.filename, u8FileName.c_str()) == 0;
282 });
283 if (res != _scenarioList.end())
284 {
285 return std::distance(_scenarioList.begin(), res);
286 }
287 return std::nullopt;
288 }
289
290 // 0x004447DF
291 static void createIndex(const ScenarioFolderState& currentState)

Callers 2

createIndexFunction · 0.85
saveNewScoreFunction · 0.85

Calls 2

endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected