1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 09:05:19 +02:00

Add operator!= to Inventory(List), make operator== a const method

This commit is contained in:
Kahrl
2014-01-11 19:46:37 +01:00
parent 84b94eb198
commit 51e6feb17c
2 changed files with 13 additions and 5 deletions

View File

@@ -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);