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

Function classifyGamePath

src/openrct2/platform/Platform.Common.cpp:139–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137#endif
138
139 std::optional<RCT2Variant> classifyGamePath(std::string_view path)
140 {
141 auto combinedPath = Path::ResolveCasing(Path::Combine(path, u8"Data", u8"g1.dat"));
142 if (File::Exists(combinedPath))
143 return std::make_optional<RCT2Variant>(RCT2Variant::rct2Original);
144
145 combinedPath = Path::ResolveCasing(Path::Combine(path, kRCTClassicWindowsDataFolder, u8"g1.dat"));
146 if (File::Exists(combinedPath))
147 return std::make_optional<RCT2Variant>(RCT2Variant::rctClassicWindows);
148
149 combinedPath = Path::ResolveCasing(Path::Combine(path, kRCTClassicMacOSDataFolder, u8"g1.dat"));
150 if (File::Exists(combinedPath))
151 return std::make_optional<RCT2Variant>(RCT2Variant::rctClassicMac);
152
153 combinedPath = Path::ResolveCasing(Path::Combine(path, kRCTClassicPlusMacOSDataFolder, u8"g1.dat"));
154 if (File::Exists(combinedPath))
155 return std::make_optional<RCT2Variant>(RCT2Variant::rctClassicPlusMac);
156
157 return std::nullopt;
158 }
159
160 bool OriginalGameDataExists(std::string_view path)
161 {

Callers 2

SetBasePathMethod · 0.85
OriginalGameDataExistsFunction · 0.85

Calls 3

ExistsFunction · 0.85
ResolveCasingFunction · 0.70
CombineFunction · 0.50

Tested by

no test coverage detected