1 #ifndef COMMON_INVENTORY_H_
2 #define COMMON_INVENTORY_H_
16 bool Add(const Item *, int count = 1);
17 void Remove(const Item *, int count = 1);
18 void RemoveAll(const Item *);
20 int MaxItems() const { return 96; }
22 bool AddScenarioItem(const Item *);
23 const Item *ScenarioItemAt(int offset) const { return scenario[offset]; }
24 int NumScenarioItems() const { return scenarioEnd; }
25 int MaxScenarioItems() const { return 64; }
27 const Item *ItemAt(int offset) const { return entries[offset].item; }
28 int ItemCountAt(int offset) const { return entries[offset].count; }
31 void SwapEntriesAt(int lhs, int rhs);
35 Entry() : item(0), count(0) { }
38 static bool Less(const Entry &, const Entry &);
42 Entry *FindItem(const Item *);
43 const Entry *FindItem(const Item *) const;
44 bool SloteFree(int offset) const;
48 const Item *scenario[64];
55 #endif /* COMMON_INVENTORY_H_ */