Initial changes to clean up the code.

This commit is contained in:
Zed A. Shaw 2025-01-10 11:12:14 -05:00
parent 8d3ccd935d
commit f3f875ee80
8 changed files with 21 additions and 29 deletions

View file

@ -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;
}