From 51629a66ff14a9025d9bd9ea69831e3d824a0760 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 30 Apr 2017 16:16:41 -0400 Subject: mem track+, drop func. added --- include/inventory.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/inventory.hpp b/include/inventory.hpp index 8329d72..1de22dc 100644 --- a/include/inventory.hpp +++ b/include/inventory.hpp @@ -75,8 +75,8 @@ struct InventoryEntry { vec2 loc; /**< Used by render, to determine slot location on screen */ - InventoryEntry(void) - : item(nullptr), count(0) {} + InventoryEntry(Item* i = nullptr, int c = 0, vec2 l = vec2()) + : item(i), count(c), loc(l) {} }; struct UseItemEvent { @@ -139,8 +139,11 @@ public: */ static bool take(const std::string& name, int count); - static inline Item getItem(const std::string& s) - { return itemList[s]; } + static void makeDrop(const vec2& p, InventoryEntry& ie); + static void makeDrop(const vec2& p, const std::string& s, int c); + + static inline Item* getItem(const std::string& s) + { return &itemList[s]; } }; #endif // INVENTORY_HPP_ -- cgit v1.2.3