summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/sell.h25
-rw-r--r--src/gui/shop.cpp9
2 files changed, 17 insertions, 17 deletions
diff --git a/src/gui/sell.h b/src/gui/sell.h
index 1a5fabf5..86caff55 100644
--- a/src/gui/sell.h
+++ b/src/gui/sell.h
@@ -24,10 +24,7 @@
#ifndef _TMW_SELL_H
#define _TMW_SELL_H
-#include <vector>
-
#include <guichan/actionlistener.hpp>
-#include <guichan/listmodel.hpp>
#include "window.h"
@@ -35,16 +32,15 @@
class Item;
class Network;
+class ShopItems;
-struct ITEM_SHOP;
/**
* The sell dialog.
*
* \ingroup Interface
*/
-class SellDialog : public Window, public gcn::ActionListener,
- public gcn::ListModel
+class SellDialog : public Window, public gcn::ActionListener
{
public:
/**
@@ -55,6 +51,11 @@ class SellDialog : public Window, public gcn::ActionListener,
SellDialog(Network *network);
/**
+ * Destructor
+ */
+ virtual ~SellDialog();
+
+ /**
* Resets the dialog, clearing inventory.
*/
void reset();
@@ -70,20 +71,10 @@ class SellDialog : public Window, public gcn::ActionListener,
void action(const std::string& eventId);
/**
- * Returns the number of items in the inventory.
- */
- int getNumberOfElements();
-
- /**
* Mouse callback
*/
void mouseClick(int x, int y, int buton, int count);
- /**
- * Returns the name of item number i in the inventory.
- */
- std::string getElementAt(int i);
-
private:
Network *mNetwork;
gcn::Button *sellButton;
@@ -98,7 +89,7 @@ class SellDialog : public Window, public gcn::ActionListener,
gcn::Label *quantityLabel;
gcn::Slider *slider;
- std::vector<ITEM_SHOP> shopInventory;
+ ShopItems *mShopItems;
int m_maxItems;
int m_amountItems;
diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp
index 1dd498a8..3706cdf8 100644
--- a/src/gui/shop.cpp
+++ b/src/gui/shop.cpp
@@ -23,3 +23,12 @@
#include "shop.h"
+int ShopItems::getNumberOfElements()
+{
+ return size();
+}
+
+std::string ShopItems::getElementAt(int i)
+{
+ return at(i).name;
+}