00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SHOP_H
00023 #define SHOP_H
00024
00025 #include <guichan/listmodel.hpp>
00026
00027 #include <string>
00028 #include <vector>
00029
00030 class ShopItem;
00031
00041 class ShopItems : public gcn::ListModel
00042 {
00043 public:
00050 ShopItems(bool mergeDuplicates = false);
00051
00052 ~ShopItems();
00053
00057 void addItem(int id, int amount, int price);
00058
00068 void addItem(int inventoryIndex, int id, int amount, int price);
00069
00073 int getNumberOfElements();
00074
00080 std::string getElementAt(int i);
00081
00085 ShopItem *at(int i) const;
00086
00092 void erase(int i);
00093
00097 void clear();
00098
00099 private:
00106 ShopItem *findItem(int id);
00107
00109 std::vector<ShopItem*> mShopItems;
00110
00112 bool mMergeDuplicates;
00113 };
00114
00115 #endif // SHOP_H