Inventory system is mostly working and I can pick up everything and use it.
This commit is contained in:
parent
aaa6d9f9f3
commit
14b3ea7676
8 changed files with 56 additions and 47 deletions
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue