summaryrefslogtreecommitdiffstats
path: root/source/cItem.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-18 11:56:28 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-18 11:56:28 +0200
commit2691e8daed826e944ca38f4787c77273edbf9404 (patch)
tree3f9fca349df2253c2c314abf2e0c22e8af7f9604 /source/cItem.h
parentAdded Core files to the VC2008 project (so that they can be opened from the IDE there, nothing more) (diff)
downloadcuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar
cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.gz
cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.bz2
cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.lz
cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.xz
cuberite-2691e8daed826e944ca38f4787c77273edbf9404.tar.zst
cuberite-2691e8daed826e944ca38f4787c77273edbf9404.zip
Diffstat (limited to 'source/cItem.h')
-rw-r--r--source/cItem.h41
1 files changed, 34 insertions, 7 deletions
diff --git a/source/cItem.h b/source/cItem.h
index 15a6e3ca1..53764d06a 100644
--- a/source/cItem.h
+++ b/source/cItem.h
@@ -39,9 +39,23 @@ public:
{
return (m_ItemID <= 0 || m_ItemCount <= 0);
}
- bool Equals( cItem & a_Item ) const
+
+ // tolua_end
+ OBSOLETE
+ // tolua_begin
+ bool Equals(const cItem & a_Item) const // obsolete, use IsEqual() instead
+ {
+ return IsEqual(a_Item);
+ }
+
+ bool IsEqual(const cItem & a_Item) const
+ {
+ return (IsSameType(a_Item) && (m_ItemHealth == a_Item.m_ItemHealth));
+ }
+
+ bool IsSameType(const cItem & a_Item) const
{
- return ( (m_ItemID == a_Item.m_ItemID) && (m_ItemHealth == a_Item.m_ItemHealth) );
+ return (m_ItemID == a_Item.m_ItemID) || (IsEmpty() && a_Item.IsEmpty());
}
// TODO Sorry for writing the functions in the header. But somehow it doesn´t worked when I put them into the cpp File :s
@@ -100,12 +114,25 @@ public:
void FromJson( const Json::Value & a_Value );
// tolua_begin
- static bool IsEnchantable(ENUM_ITEM_ID item);
-
- ENUM_ITEM_ID m_ItemID;
- char m_ItemCount;
- short m_ItemHealth;
+ static bool IsEnchantable(short a_ItemType);
+ // tolua_end
+ union
+ {
+ // tolua_begin
+ ENUM_ITEM_ID m_ItemID; // OBSOLETE, use m_ItemType instead
+ short m_ItemType;
+ // tolua_end
+ } ;
+ char m_ItemCount; // tolua_export
+ union
+ {
+ // tolua_begin
+ short m_ItemHealth; // OBSOLETE, use m_ItemDamage instead
+ short m_ItemDamage;
+ // tolua_end
+ } ;
+ // tolua_begin
};
// tolua_end