Quick refactor of the config system to make it easier to refactor config.cpp/hpp later.
This commit is contained in:
parent
47f659ae8e
commit
e523aa8b02
29 changed files with 138 additions and 140 deletions
|
|
@ -2,7 +2,6 @@
|
|||
#include "components.hpp"
|
||||
#include "worldbuilder.hpp"
|
||||
#include "constants.hpp"
|
||||
#include "save.hpp"
|
||||
#include "systems.hpp"
|
||||
#include "components.hpp"
|
||||
#include "rituals.hpp"
|
||||
|
|
@ -21,7 +20,7 @@ inline shared_ptr<DinkyECS::World> clone_load_world(shared_ptr<DinkyECS::World>
|
|||
auto world = make_shared<DinkyECS::World>();
|
||||
|
||||
if(prev_world == nullptr) {
|
||||
save::load_configs(*world);
|
||||
GameDB::load_configs(*world);
|
||||
} else {
|
||||
prev_world->clone_into(*world);
|
||||
}
|
||||
|
|
@ -134,4 +133,16 @@ namespace GameDB {
|
|||
dbc::check(initialized, "Forgot to call GameDB::init()");
|
||||
return current_level().player;
|
||||
}
|
||||
|
||||
void load_configs(DinkyECS::World &world) {
|
||||
world.set_the<GameConfig>({
|
||||
settings::get("config"),
|
||||
settings::get("enemies"),
|
||||
settings::get("items"),
|
||||
settings::get("tiles"),
|
||||
settings::get("devices"),
|
||||
settings::get("bosses"),
|
||||
settings::get("rituals")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue