aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-04-30 16:16:41 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-04-30 16:16:41 -0400
commit51629a66ff14a9025d9bd9ea69831e3d824a0760 (patch)
tree6e749c251d7b41d9bb3bf5362ccfe6aa18527f0e /include
parent40d164ea3d8437cd5a06a06d5b89bd938d3dd906 (diff)
mem track+, drop func. added
Diffstat (limited to 'include')
-rw-r--r--include/inventory.hpp11
1 files changed, 7 insertions, 4 deletions
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_