aboutsummaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2022-05-17 22:12:00 +0200
commit21df26984da91143c15587f5a03c98d68c3adc4e (patch)
treeaaa707a628ad331f67890023dffe1b4f60dd01d3 /src/inventory.cpp
parentb09fc5de5cdb021f43ad32b7e3f50dc75c0bc622 (diff)
parenteabf05758e3ba5f6f4bb1b8d1d1f02179b84e410 (diff)
downloaddragonfireclient-21df26984da91143c15587f5a03c98d68c3adc4e.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp49
1 files changed, 1 insertions, 48 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index da6517e62..6d2b7fba3 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -503,11 +503,6 @@ void InventoryList::deSerialize(std::istream &is)
throw SerializationError(ss.str());
}
-InventoryList::InventoryList(const InventoryList &other)
-{
- *this = other;
-}
-
InventoryList & InventoryList::operator = (const InventoryList &other)
{
m_items = other.m_items;
@@ -535,21 +530,6 @@ bool InventoryList::operator == (const InventoryList &other) const
return true;
}
-const std::string &InventoryList::getName() const
-{
- return m_name;
-}
-
-u32 InventoryList::getSize() const
-{
- return m_items.size();
-}
-
-u32 InventoryList::getWidth() const
-{
- return m_width;
-}
-
u32 InventoryList::getUsedSlots() const
{
u32 num = 0;
@@ -560,23 +540,6 @@ u32 InventoryList::getUsedSlots() const
return num;
}
-u32 InventoryList::getFreeSlots() const
-{
- return getSize() - getUsedSlots();
-}
-
-const ItemStack& InventoryList::getItem(u32 i) const
-{
- assert(i < m_size); // Pre-condition
- return m_items[i];
-}
-
-ItemStack& InventoryList::getItem(u32 i)
-{
- assert(i < m_size); // Pre-condition
- return m_items[i];
-}
-
ItemStack InventoryList::changeItem(u32 i, const ItemStack &newitem)
{
if(i >= m_items.size())
@@ -965,16 +928,6 @@ InventoryList * Inventory::getList(const std::string &name)
return m_lists[i];
}
-std::vector<const InventoryList*> Inventory::getLists()
-{
- std::vector<const InventoryList*> lists;
- lists.reserve(m_lists.size());
- for (auto list : m_lists) {
- lists.push_back(list);
- }
- return lists;
-}
-
bool Inventory::deleteList(const std::string &name)
{
s32 i = getListIndex(name);
@@ -995,7 +948,7 @@ const InventoryList *Inventory::getList(const std::string &name) const
return m_lists[i];
}
-const s32 Inventory::getListIndex(const std::string &name) const
+s32 Inventory::getListIndex(const std::string &name) const
{
for(u32 i=0; i<m_lists.size(); i++)
{