X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FInventory.cpp;h=d8ba20c08af5a35c0af1d1311ab2474259634449;hb=ec18252fd6199492c40b98abab289c375a5a41b7;hp=6a6af81f3b52fe3dd0f94875cde38f00689f016b;hpb=89aa9fbc77d72e98549bc3aabd7ced7cd8949bdc;p=l2e.git diff --git a/src/common/Inventory.cpp b/src/common/Inventory.cpp index 6a6af81..d8ba20c 100644 --- a/src/common/Inventory.cpp +++ b/src/common/Inventory.cpp @@ -53,6 +53,10 @@ void Inventory::Remove(const Item *item, int count) { } } +void Inventory::RemoveAll(const Item *item) { + Remove(item, 255); +} + Inventory::Entry *Inventory::FindItem(const Item *item) { for (int i(0); i < MaxItems(); ++i) { if (item == ItemAt(i)) { @@ -83,4 +87,8 @@ bool Inventory::Entry::Less(const Entry &lhs, const Entry &rhs) { } } +void Inventory::SwapEntriesAt(int lhs, int rhs) { + std::swap(entries[lhs], entries[rhs]); +} + }