summaryrefslogtreecommitdiffstats
path: root/source/Item.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-02 12:40:20 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-02 12:40:20 +0200
commita19a0701211e0a5563dc77845e11a3f3308e2b32 (patch)
treee7ffbd81402a008a2dc8234fef39f53e31d97f03 /source/Item.h
parentStringUtils: Fixed the HexDump in DEBUG mode (diff)
downloadcuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar
cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.gz
cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.bz2
cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.lz
cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.xz
cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.tar.zst
cuberite-a19a0701211e0a5563dc77845e11a3f3308e2b32.zip
Diffstat (limited to 'source/Item.h')
-rw-r--r--source/Item.h35
1 files changed, 26 insertions, 9 deletions
diff --git a/source/Item.h b/source/Item.h
index 45b124e67..fee549a2c 100644
--- a/source/Item.h
+++ b/source/Item.h
@@ -1,7 +1,20 @@
+
+// Item.h
+
+// Declares the cItem class representing an item (in the inventory sense)
+
+
+
+
+
#pragma once
#include "Defines.h"
-#include "BlockID.h"
+#include "Enchantments.h"
+
+
+
+
namespace Json
{
@@ -25,15 +38,17 @@ public:
}
- /// Creates an item of the specified type, by default 1 piece with no damage
+ /// Creates an item of the specified type, by default 1 piece with no damage and no enchantments
cItem(
short a_ItemType,
char a_ItemCount = 1,
- short a_ItemDamage = 0
+ short a_ItemDamage = 0,
+ const AString & a_Enchantments = ""
) :
- m_ItemType (a_ItemType),
- m_ItemCount (a_ItemCount),
- m_ItemDamage(a_ItemDamage)
+ m_ItemType (a_ItemType),
+ m_ItemCount (a_ItemCount),
+ m_ItemDamage (a_ItemDamage),
+ m_Enchantments(a_Enchantments)
{
if (!IsValidItem(m_ItemType))
{
@@ -48,6 +63,7 @@ public:
m_ItemType = E_ITEM_EMPTY;
m_ItemCount = 0;
m_ItemDamage = 0;
+ m_Enchantments.Clear();
}
@@ -98,9 +114,10 @@ public:
static bool IsEnchantable(short a_ItemType);
- short m_ItemType;
- char m_ItemCount;
- short m_ItemDamage;
+ short m_ItemType;
+ char m_ItemCount;
+ short m_ItemDamage;
+ cEnchantments m_Enchantments;
};
// tolua_end