MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / load

Method load

App/save_system/AppStateIO.cpp:274–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void 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
292void AppStateIO::loadLuaScene(Lattice::Simulation& simulation, std::string_view path) {
293 Lattice::LuaState luaState;

Callers

nothing calls this directly

Calls 1

lowercaseExtensionFunction · 0.70

Tested by

no test coverage detected