diff options
author | DS <vorunbekannt75@web.de> | 2022-03-29 18:06:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 18:06:16 +0200 |
commit | 8d387433b14791db95e59127b5e6e30f58155c1e (patch) | |
tree | f7ce345cb892a6c9fdc0f210559e744c57e1f0d4 /src/inventory.cpp | |
parent | 0f25fa7af655b98fa401176a523f269c843d1943 (diff) | |
download | minetest-8d387433b14791db95e59127b5e6e30f58155c1e.tar.xz |
Fix the documentation of InvRef:get_lists() and clean up code (#12150)
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index d14b12f9d..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,18 +540,6 @@ u32 InventoryList::getUsedSlots() const return num; } -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()) @@ -960,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); |