Initial changes to clean up the code.
This commit is contained in:
parent
8d3ccd935d
commit
f3f875ee80
8 changed files with 21 additions and 29 deletions
|
@ -17,9 +17,9 @@ using namespace components;
|
|||
|
||||
DinkyECS::Entity add_items(DinkyECS::World &world, GameConfig &config) {
|
||||
auto sword = world.entity();
|
||||
world.set<InventoryItem>(sword, {1, config.items["SWORD_RUSTY"]});
|
||||
world.set<Tile>(sword, {config.items["SWORD_RUSTY"]["display"]});
|
||||
|
||||
json& item_data = config.items["SWORD_RUSTY"];
|
||||
world.set<InventoryItem>(sword, {item_data["inventory_count"], item_data});
|
||||
components::configure(world, sword, item_data);
|
||||
return sword;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue