summaryrefslogtreecommitdiff
path: root/src/gui/shop.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-15 23:44:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-15 23:44:01 +0000
commit0e925e97554aae573e895afa4e3d8450f01df342 (patch)
treebbc30319410aecb9fec7c005e667cd7fb628bb17 /src/gui/shop.h
parentffa0fae492d954c0aed35a0acbd7b856778d7328 (diff)
downloadmana-client-0e925e97554aae573e895afa4e3d8450f01df342.tar.gz
mana-client-0e925e97554aae573e895afa4e3d8450f01df342.tar.bz2
mana-client-0e925e97554aae573e895afa4e3d8450f01df342.tar.xz
mana-client-0e925e97554aae573e895afa4e3d8450f01df342.zip
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.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/gui/shop.h b/src/gui/shop.h
index 665e92cb..281f4c6d 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 and its associated picture.
*/
void addItem(int id, int amount, int price);
/**
- * Convenience function for adding items
+ * Convenience function for adding items.
*/
- void push_back(ITEM_SHOP item_shop);
+ void addItem(ShopItem* shopItem);
/**
* 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);
/**
* 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