| 255 | } |
| 256 | |
| 257 | std::unique_ptr<Object> CreateObjectFromFile(u8string_view path, bool loadImages) |
| 258 | { |
| 259 | std::unique_ptr<Object> object; |
| 260 | auto extension = Path::GetExtension(path); |
| 261 | if (String::iequals(extension, ".json")) |
| 262 | { |
| 263 | auto pathStr = u8string(path); |
| 264 | object = CreateObjectFromJsonFile(pathStr, loadImages); |
| 265 | } |
| 266 | else if (String::iequals(extension, ".parkobj")) |
| 267 | { |
| 268 | object = CreateObjectFromZipFile(path, loadImages); |
| 269 | } |
| 270 | else |
| 271 | { |
| 272 | auto pathStr = u8string(path); |
| 273 | object = CreateObjectFromLegacyFile(pathStr.c_str(), loadImages); |
| 274 | } |
| 275 | |
| 276 | return object; |
| 277 | } |
| 278 | |
| 279 | std::unique_ptr<Object> CreateObjectFromLegacyFile(const utf8* path, bool loadImages) |
| 280 | { |
no test coverage detected