forked from Mirrorlandia_minetest/minetest
Add operator!= to Inventory(List), make operator== a const method
This commit is contained in:
parent
84b94eb198
commit
51e6feb17c
@ -562,7 +562,7 @@ InventoryList & InventoryList::operator = (const InventoryList &other)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InventoryList::operator == (const InventoryList &other)
|
bool InventoryList::operator == (const InventoryList &other) const
|
||||||
{
|
{
|
||||||
if(m_size != other.m_size)
|
if(m_size != other.m_size)
|
||||||
return false;
|
return false;
|
||||||
@ -875,7 +875,7 @@ Inventory & Inventory::operator = (const Inventory &other)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Inventory::operator == (const Inventory &other)
|
bool Inventory::operator == (const Inventory &other) const
|
||||||
{
|
{
|
||||||
if(m_lists.size() != other.m_lists.size())
|
if(m_lists.size() != other.m_lists.size())
|
||||||
return false;
|
return false;
|
||||||
|
@ -182,7 +182,11 @@ public:
|
|||||||
|
|
||||||
InventoryList(const InventoryList &other);
|
InventoryList(const InventoryList &other);
|
||||||
InventoryList & operator = (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;
|
const std::string &getName() const;
|
||||||
u32 getSize() const;
|
u32 getSize() const;
|
||||||
@ -258,7 +262,11 @@ public:
|
|||||||
Inventory(IItemDefManager *itemdef);
|
Inventory(IItemDefManager *itemdef);
|
||||||
Inventory(const Inventory &other);
|
Inventory(const Inventory &other);
|
||||||
Inventory & operator = (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 serialize(std::ostream &os) const;
|
||||||
void deSerialize(std::istream &is);
|
void deSerialize(std::istream &is);
|
||||||
|
Loading…
Reference in New Issue
Block a user