1 #ifndef COMMON_INVENTORY_H_
2 #define COMMON_INVENTORY_H_
18 bool Add(const Item *, int count = 1);
19 void Remove(const Item *, int count = 1);
20 void RemoveAll(const Item *);
22 int MaxItems() const { return 96; }
24 bool AddScenarioItem(const Item *);
25 const Item *ScenarioItemAt(int offset) const { return scenario[offset]; }
26 int NumScenarioItems() const { return scenarioEnd; }
27 int MaxScenarioItems() const { return 64; }
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;
50 const Item *scenario[64];
57 #endif /* COMMON_INVENTORY_H_ */