Now standardized on GameConfig everywhere I can. Closes #28.
This commit is contained in:
parent
b0204772c7
commit
769530b45c
3 changed files with 3 additions and 4 deletions
|
@ -36,8 +36,7 @@ namespace ritual {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::load_junk(CraftingState& ritual, const JunkItem& item) {
|
void Engine::load_junk(CraftingState& ritual, const JunkItem& item) {
|
||||||
Config config("assets/rituals.json");
|
auto& junk = $config["junk"];
|
||||||
auto& junk = config["junk"];
|
|
||||||
auto& item_desc = junk[item];
|
auto& item_desc = junk[item];
|
||||||
|
|
||||||
fmt::print("Item {} provides: ", item);
|
fmt::print("Item {} provides: ", item);
|
||||||
|
|
|
@ -487,7 +487,7 @@ std::shared_ptr<sf::Shader> System::sprite_effect(GameLevel &level, Entity entit
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity System::spawn_item(World& world, const std::string& name) {
|
Entity System::spawn_item(World& world, const std::string& name) {
|
||||||
Config config("assets/items.json");
|
auto& config = world.get_the<GameConfig>().items;
|
||||||
auto& item_config = config[name];
|
auto& item_config = config[name];
|
||||||
auto item_id = world.entity();
|
auto item_id = world.entity();
|
||||||
world.set<InventoryItem>(item_id, {1, item_config});
|
world.set<InventoryItem>(item_id, {1, item_config});
|
||||||
|
|
|
@ -168,7 +168,7 @@ void WorldBuilder::place_stairs(DinkyECS::World& world, GameConfig& config) {
|
||||||
|
|
||||||
void WorldBuilder::configure_starting_items(DinkyECS::World &world) {
|
void WorldBuilder::configure_starting_items(DinkyECS::World &world) {
|
||||||
auto& blanket = world.get_the<ritual::Blanket>();
|
auto& blanket = world.get_the<ritual::Blanket>();
|
||||||
Config config("assets/rituals.json");
|
auto& config = world.get_the<components::GameConfig>().rituals;
|
||||||
|
|
||||||
for(auto& el : config["starting_junk"]) {
|
for(auto& el : config["starting_junk"]) {
|
||||||
ritual::JunkItem name = el;
|
ritual::JunkItem name = el;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue