summaryrefslogtreecommitdiffstats
path: root/source/cItem.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-19 13:51:17 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-19 13:51:17 +0200
commiteb3ed1aec1fb9e4468a7829cabd42572b7554d70 (patch)
tree4b5f428bf612785af8c306ba40f46c66fe0681a0 /source/cItem.h
parentFixed Bug #236 (diff)
downloadcuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.gz
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.bz2
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.lz
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.xz
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.tar.zst
cuberite-eb3ed1aec1fb9e4468a7829cabd42572b7554d70.zip
Diffstat (limited to 'source/cItem.h')
-rw-r--r--source/cItem.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/cItem.h b/source/cItem.h
index 53764d06a..aa4b76bbc 100644
--- a/source/cItem.h
+++ b/source/cItem.h
@@ -16,25 +16,28 @@ namespace Json
class cItem
{
public:
- cItem( ENUM_ITEM_ID a_ItemID = E_ITEM_EMPTY, char a_ItemCount = 0, short a_ItemHealth = 0 )
- : m_ItemID ( a_ItemID )
- , m_ItemCount ( a_ItemCount )
- , m_ItemHealth ( a_ItemHealth )
+ cItem(short a_ItemType = E_ITEM_EMPTY, char a_ItemCount = 0, short a_ItemHealth = 0)
+ : m_ItemType (a_ItemType)
+ , m_ItemCount (a_ItemCount)
+ , m_ItemHealth(a_ItemHealth)
{
- if(!IsValidItem( m_ItemID ) ) m_ItemID = E_ITEM_EMPTY;
+ if (!IsValidItem( m_ItemID ) ) m_ItemID = E_ITEM_EMPTY;
}
+
void Empty()
{
m_ItemID = E_ITEM_EMPTY;
m_ItemCount = 0;
m_ItemHealth = 0;
}
+
void Clear(void)
{
m_ItemID = E_ITEM_EMPTY;
m_ItemCount = 0;
m_ItemHealth = 0;
}
+
bool IsEmpty(void) const
{
return (m_ItemID <= 0 || m_ItemCount <= 0);
@@ -120,8 +123,8 @@ public:
union
{
// tolua_begin
- ENUM_ITEM_ID m_ItemID; // OBSOLETE, use m_ItemType instead
- short m_ItemType;
+ short m_ItemID; // OBSOLETE, use m_ItemType instead
+ short m_ItemType;
// tolua_end
} ;
char m_ItemCount; // tolua_export