summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/inventory.h b/src/inventory.h
index 40a9403a..4a0ff6c9 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -22,6 +22,8 @@
#pragma once
#include <list>
+#include <memory>
+#include <vector>
class Inventory;
class Item;
@@ -62,7 +64,7 @@ class Inventory
/**
* Returns the size that this instance is configured for.
*/
- int getSize() const { return mSize; }
+ int getSize() const { return mItems.size(); }
/**
* Returns the item at the specified index.
@@ -88,11 +90,6 @@ class Inventory
void setItem(int index, int id, int quantity);
/**
- * Remove a item from the inventory.
- */
- void removeItem(int id);
-
- /**
* Remove the item at the specified index from the inventory.
*/
void removeItemAt(int index);
@@ -138,7 +135,6 @@ class Inventory
void distributeSlotsChangedEvent();
Type mType;
- Item **mItems; /**< The holder of items */
- int mSize; /**< The max number of inventory items */
- int mUsed = 0; /**< THe number of slots in use */
+ std::vector<std::unique_ptr<Item>> mItems; /**< The holder of items */
+ int mUsed = 0; /**< The number of slots in use */
};