Inventory system is mostly working and I can pick up everything and use it.

This commit is contained in:
Zed A. Shaw 2025-01-04 13:32:26 -05:00
parent aaa6d9f9f3
commit 14b3ea7676
8 changed files with 56 additions and 47 deletions

View file

@ -16,16 +16,16 @@ namespace components {
struct Inventory {
int gold;
LightSource light;
std::unordered_map<std::string, InventoryItem> items;
std::vector<InventoryItem> items;
size_t count() { return items.size(); }
void add(InventoryItem item);
bool decrease(std::string id, int count);
bool decrease(size_t at, int count);
InventoryItem& get(std::string id);
InventoryItem& get(size_t at);
void remove_all(std::string id);
void erase_item(size_t at);
};
}