X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FInventory.h;h=aaf315cc6bd7cd4608706bb3e99e1a36984f60bd;hb=6a954cc1f6324d61282e21ec0d7dee6e6265f44f;hp=2443078c708389bf72fc004d150b4a85fea53ce6;hpb=341371f1ac26af555407bf9fe9b78794297a385b;p=l2e.git diff --git a/src/common/Inventory.h b/src/common/Inventory.h index 2443078..aaf315c 100644 --- a/src/common/Inventory.h +++ b/src/common/Inventory.h @@ -8,12 +8,12 @@ #ifndef COMMON_INVENTORY_H_ #define COMMON_INVENTORY_H_ +#include "fwd.h" + #include namespace common { -class Item; - class Inventory { public: @@ -22,17 +22,22 @@ public: public: bool Add(const Item *, int count = 1); void Remove(const Item *, int count = 1); + void RemoveAll(const Item *); int MaxItems() const { return 96; } const Item *ItemAt(int offset) const { return entries[offset].item; } int ItemCountAt(int offset) const { return entries[offset].count; } + void Sort(); + void SwapEntriesAt(int lhs, int rhs); + private: struct Entry { Entry() : item(0), count(0) { } const Item *item; Uint8 count; + static bool Less(const Entry &, const Entry &); }; private: