Move load config for world to factory
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user