Move load config for world to factory

This commit is contained in:
Jiga228
2025-10-07 20:12:10 +07:00
parent bd8b0aec96
commit bb48fb6dfb
2 changed files with 14 additions and 9 deletions
-8
View File
@@ -19,13 +19,6 @@ GameInstance::GameInstance(CoreInstance& core) : core(core)
// Init directories
std::filesystem::create_directories(std::filesystem::path("./Resources"));
std::ifstream file("./Worlds/" + base_world + ".world");
if (file.fail())
throw std::runtime_error("Can't open world file");
std::string data;
std::getline(file, data);
for (auto& factories : world_factories)
{
if (factories.world_name == base_world)
@@ -38,7 +31,6 @@ GameInstance::GameInstance(CoreInstance& core) : core(core)
if (world == nullptr)
throw std::runtime_error("Can't find world");
world->load(std::make_shared<SaveMap>(data));
}
GameInstance::~GameInstance()