From 6374ef220d8f46647190074338f868b5d6bb4a45 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 5 Nov 2006 15:22:13 +0000 Subject: Merged 0.0 changes from revision 2800 to 2825 to trunk. --- src/gui/shop.h | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'src/gui/shop.h') diff --git a/src/gui/shop.h b/src/gui/shop.h index fb1f33fd..de452b5c 100644 --- a/src/gui/shop.h +++ b/src/gui/shop.h @@ -28,22 +28,34 @@ #include #include +#include "../resources/image.h" struct ITEM_SHOP { + short id; std::string name; + Image *image; int price; - short id; int index; int quantity; }; -class ShopItems : public std::vector, public gcn::ListModel +class ShopItems : public gcn::ListModel { public: /** * Destructor */ - virtual ~ShopItems() {}; + ~ShopItems(); + + /** + * Adds an item and its associated picture + */ + void addItem(short id, int price); + + /** + * Convenience function for adding items + */ + void push_back(ITEM_SHOP item_shop); /** * Returns the number of items in the shop. @@ -54,6 +66,25 @@ class ShopItems : public std::vector, public gcn::ListModel * Returns the name of item number i in the shop. */ std::string getElementAt(int i); + + /** + * Returns the item number i in the shop. + */ + ITEM_SHOP at(int i); + + /** + * Clear the vector. + */ + void clear(); + + /** + * Direct access to the vector + */ + std::vector* getShop(); + + private: + std::vector mItemsShop; + }; #endif -- cgit v1.2.3-70-g09d2