summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2014-01-11 19:46:37 +0100
committerKahrl <kahrl@gmx.net>2014-01-11 19:46:37 +0100
commit51e6feb17c5929c60b5e8b87cb02c0d22ddb6ff5 (patch)
tree64513f98158e480666810ae4bc072bdc9f3b91fc /src/inventory.h
parent84b94eb19804484b689cec441e175628fd10335f (diff)
downloadminetest-51e6feb17c5929c60b5e8b87cb02c0d22ddb6ff5.tar.gz
minetest-51e6feb17c5929c60b5e8b87cb02c0d22ddb6ff5.tar.bz2
minetest-51e6feb17c5929c60b5e8b87cb02c0d22ddb6ff5.zip
Add operator!= to Inventory(List), make operator== a const method
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/inventory.h b/src/inventory.h
index cd592a17a..52b776db3 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -182,7 +182,11 @@ public:
InventoryList(const InventoryList &other);
InventoryList & operator = (const InventoryList &other);
- bool operator == (const InventoryList &other);
+ bool operator == (const InventoryList &other) const;
+ bool operator != (const InventoryList &other) const
+ {
+ return !(*this == other);
+ }
const std::string &getName() const;
u32 getSize() const;
@@ -258,8 +262,12 @@ public:
Inventory(IItemDefManager *itemdef);
Inventory(const Inventory &other);
Inventory & operator = (const Inventory &other);
- bool operator == (const Inventory &other);
-
+ bool operator == (const Inventory &other) const;
+ bool operator != (const Inventory &other) const
+ {
+ return !(*this == other);
+ }
+
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);