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);
26 int MaxItems() const { return 96; }
28 const Item *ItemAt(int offset) const { return entries[offset].item; }
29 int ItemCountAt(int offset) const { return entries[offset].count; }
32 void SwapEntriesAt(int lhs, int rhs);
36 Entry() : item(0), count(0) { }
39 static bool Less(const Entry &, const Entry &);
43 Entry *FindItem(const Item *);
44 const Entry *FindItem(const Item *) const;
45 bool SloteFree(int offset) const;
54 #endif /* COMMON_INVENTORY_H_ */