summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2017-01-31 19:49:01 +0000
committerrubenwardy <rubenwardy@gmail.com>2017-02-04 22:07:55 +0000
commitf2aa2c6a986dec47856c49ae5f54fbf3c688e027 (patch)
treed12fbb3e62776efaafe059a7fdbfa9938e7298cd /src/inventory.h
parentc2e7b1f57941cb34cb7e3d71dc040fad53a64e3e (diff)
downloadminetest-f2aa2c6a986dec47856c49ae5f54fbf3c688e027.tar.gz
minetest-f2aa2c6a986dec47856c49ae5f54fbf3c688e027.tar.bz2
minetest-f2aa2c6a986dec47856c49ae5f54fbf3c688e027.zip
Add ItemStack key-value meta storage
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/inventory.h b/src/inventory.h
index 7d7e58d61..fe1639728 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "debug.h"
#include "itemdef.h"
#include "irrlichttypes.h"
+#include "itemstackmetadata.h"
#include <istream>
#include <ostream>
#include <string>
@@ -32,10 +33,10 @@ struct ToolCapabilities;
struct ItemStack
{
- ItemStack(): name(""), count(0), wear(0), metadata("") {}
- ItemStack(std::string name_, u16 count_,
- u16 wear, std::string metadata_,
- IItemDefManager *itemdef);
+ ItemStack(): name(""), count(0), wear(0) {}
+ ItemStack(const std::string &name_, u16 count_,
+ u16 wear, IItemDefManager *itemdef);
+
~ItemStack() {}
// Serialization
@@ -61,7 +62,7 @@ struct ItemStack
name = "";
count = 0;
wear = 0;
- metadata = "";
+ metadata.clear();
}
void add(u16 n)
@@ -166,7 +167,7 @@ struct ItemStack
std::string name;
u16 count;
u16 wear;
- std::string metadata;
+ ItemStackMetadata metadata;
};
class InventoryList
@@ -313,4 +314,3 @@ private:
};
#endif
-