| 272 | } |
| 273 | |
| 274 | void AppStateIO::load(Lattice::Simulation& simulation, BaseRenderer& renderer, std::string_view path) { |
| 275 | try { |
| 276 | const std::string extension = lowercaseExtension(path); |
| 277 | if (extension == ".lat" || extension == ".sim" || extension == ".xyz") { |
| 278 | AppStateIO::loadText(simulation, renderer, path); |
| 279 | } |
| 280 | else if (extension == ".latbin") { |
| 281 | AppStateIO::loadBinary(simulation, renderer, path); |
| 282 | } |
| 283 | else if (extension == ".lua") { |
| 284 | AppStateIO::loadLuaScene(simulation, path); |
| 285 | } |
| 286 | } |
| 287 | catch (const std::exception& e) { |
| 288 | std::cerr << "Failed to load scene '" << path << "': " << e.what() << "\n"; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | void AppStateIO::loadLuaScene(Lattice::Simulation& simulation, std::string_view path) { |
| 293 | Lattice::LuaState luaState; |
nothing calls this directly
no test coverage detected