summaryrefslogtreecommitdiff
path: root/src/gui/shop.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-06-12 09:06:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-06-12 09:06:01 +0000
commit2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258 (patch)
tree8d256ac1a38932aaf0db7b55ed178e4212616555 /src/gui/shop.h
parenteb019ab915998a3ec247b33dad4b23f763d7a29a (diff)
downloadmana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.gz
mana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.bz2
mana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.xz
mana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.zip
Merged revisions 3738 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/trunk ........ r3738 | b_lindeijer | 2007-11-16 00:44:01 +0100 (Fri, 16 Nov 2007) | 3 lines Moved item icon from ItemInfo class to the Item class, so that it can be loaded on demand. Results in faster startup time and reduced memory usage. ........
Diffstat (limited to 'src/gui/shop.h')
-rw-r--r--src/gui/shop.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/gui/shop.h b/src/gui/shop.h
index de452b5c..22e715c9 100644
--- a/src/gui/shop.h
+++ b/src/gui/shop.h
@@ -28,34 +28,28 @@
#include <vector>
#include <guichan/listmodel.hpp>
+
#include "../resources/image.h"
-struct ITEM_SHOP {
- short id;
- std::string name;
- Image *image;
- int price;
- int index;
- int quantity;
-};
+#include "../shopitem.h"
class ShopItems : public gcn::ListModel
{
public:
/**
- * Destructor
+ * Destructor.
*/
~ShopItems();
/**
- * Adds an item and its associated picture
+ * Adds an item to the list (used by sell dialog).
*/
- void addItem(short id, int price);
+ void addItem(int inventoryIndex, short id, int amount, int price);
/**
- * Convenience function for adding items
+ * Adds an item to the list (used by buy dialog).
*/
- void push_back(ITEM_SHOP item_shop);
+ void addItem(short id, int price);
/**
* Returns the number of items in the shop.
@@ -70,7 +64,7 @@ class ShopItems : public gcn::ListModel
/**
* Returns the item number i in the shop.
*/
- ITEM_SHOP at(int i);
+ ShopItem* at(int i) const;
/**
* Clear the vector.
@@ -78,13 +72,12 @@ class ShopItems : public gcn::ListModel
void clear();
/**
- * Direct access to the vector
+ * Direct access to the vector.
*/
- std::vector<ITEM_SHOP>* getShop();
+ std::vector<ShopItem*>* getShop();
private:
- std::vector<ITEM_SHOP> mItemsShop;
-
+ std::vector<ShopItem*> mShopItems;
};
#endif