summaryrefslogtreecommitdiff
path: root/src/gui/shop.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-05 15:22:13 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-05 15:22:13 +0000
commit6374ef220d8f46647190074338f868b5d6bb4a45 (patch)
treea833453c2e712c3e992f71433f6d21c8c379ad15 /src/gui/shop.h
parentde61b658590630cfc59960c012c8e533b361a8b0 (diff)
downloadmana-client-6374ef220d8f46647190074338f868b5d6bb4a45.tar.gz
mana-client-6374ef220d8f46647190074338f868b5d6bb4a45.tar.bz2
mana-client-6374ef220d8f46647190074338f868b5d6bb4a45.tar.xz
mana-client-6374ef220d8f46647190074338f868b5d6bb4a45.zip
Merged 0.0 changes from revision 2800 to 2825 to trunk.
Diffstat (limited to 'src/gui/shop.h')
-rw-r--r--src/gui/shop.h37
1 files changed, 34 insertions, 3 deletions
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 <vector>
#include <guichan/listmodel.hpp>
+#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<ITEM_SHOP>, 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<ITEM_SHOP>, 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<ITEM_SHOP>* getShop();
+
+ private:
+ std::vector<ITEM_SHOP> mItemsShop;
+
};
#endif