4 * Created on: Aug 9, 2012
8 #ifndef COMMON_INVENTORY_H_
9 #define COMMON_INVENTORY_H_
23 bool Add(const Item *, int count = 1);
24 void Remove(const Item *, int count = 1);
25 void RemoveAll(const Item *);
27 int MaxItems() const { return 96; }
29 const Item *ItemAt(int offset) const { return entries[offset].item; }
30 int ItemCountAt(int offset) const { return entries[offset].count; }
33 void SwapEntriesAt(int lhs, int rhs);
37 Entry() : item(0), count(0) { }
40 static bool Less(const Entry &, const Entry &);
44 Entry *FindItem(const Item *);
45 const Entry *FindItem(const Item *) const;
46 bool SloteFree(int offset) const;
55 #endif /* COMMON_INVENTORY_H_ */