summaryrefslogtreecommitdiffstats
path: root/sigmod
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-07-19 13:50:43 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-07-19 13:50:43 -0400
commitdffac4ac7cb7f62619bf1d0b356b17f5791fa765 (patch)
treed7f05be81da9429e7f2d9736bae58cd0647655f8 /sigmod
parent51f1d2c9d6c2a2b89821143de8fc3bce95d8f164 (diff)
downloadsigen-dffac4ac7cb7f62619bf1d0b356b17f5791fa765.tar.gz
sigen-dffac4ac7cb7f62619bf1d0b356b17f5791fa765.tar.xz
sigen-dffac4ac7cb7f62619bf1d0b356b17f5791fa765.zip
Remove sellable from item; set in sellPrice as -1
Diffstat (limited to 'sigmod')
-rw-r--r--sigmod/Item.cpp12
-rw-r--r--sigmod/Item.h16
2 files changed, 3 insertions, 25 deletions
diff --git a/sigmod/Item.cpp b/sigmod/Item.cpp
index 8f5d4387..fa18fd34 100644
--- a/sigmod/Item.cpp
+++ b/sigmod/Item.cpp
@@ -43,7 +43,6 @@ Item::Item(const Item& item) :
Item::Item(const Game* parent, const int id) :
Object(parent, id),
m_name(""),
- m_sellable(false),
m_type(-1),
m_price(0),
m_sellPrice(0),
@@ -73,8 +72,7 @@ void Item::validate()
emit(error("Name is empty"));
TEST(type);
TEST(price);
- if (m_sellable)
- TEST(sellPrice);
+ TEST(sellPrice);
TEST(weight);
TEST_END();
}
@@ -83,7 +81,6 @@ void Item::load(const QDomElement& xml)
{
LOAD_BEGIN();
LOAD(name);
- LOAD(sellable);
LOAD(type);
LOAD(price);
LOAD(sellPrice);
@@ -96,7 +93,6 @@ QDomElement Item::save() const
{
SAVE_CREATE();
SAVE(name);
- SAVE(sellable);
SAVE(type);
SAVE(price);
SAVE(sellPrice);
@@ -107,7 +103,6 @@ QDomElement Item::save() const
}
SETTER(Item, QString&, Name, name)
-SETTER(Item, bool, Sellable, sellable)
SETTER(Item, int, Type, type)
SETTER(Item, int, Price, price)
SETTER(Item, int, SellPrice, sellPrice)
@@ -116,7 +111,6 @@ SETTER(Item, QString&, Description, description)
SETTER(Item, Script&, Script, script)
GETTER(Item, QString, name)
-GETTER(Item, bool, sellable)
GETTER(Item, int, type)
GETTER(Item, int, price)
GETTER(Item, int, sellPrice)
@@ -125,10 +119,9 @@ GETTER(Item, QString, description)
GETTER(Item, Script, script)
CHECK(Item, QString&, name)
-CHECK(Item, bool, sellable)
CHECK_INDEX(Item, int, type, game(), itemType)
CHECK_BOUNDS(Item, int, price, 1, game()->rules()->maxMoney())
-CHECK_BOUNDS(Item, int, sellPrice, 0, m_price)
+CHECK_BOUNDS(Item, int, sellPrice, -1, m_price)
CHECK_BEGIN(Item, int, weight)
const ItemType* type = game()->itemTypeById(m_type);
if (type)
@@ -142,7 +135,6 @@ Item& Item::operator=(const Item& rhs)
if (this == &rhs)
return *this;
COPY(name);
- COPY(sellable);
COPY(type);
COPY(price);
COPY(sellPrice);
diff --git a/sigmod/Item.h b/sigmod/Item.h
index df477f10..905c81be 100644
--- a/sigmod/Item.h
+++ b/sigmod/Item.h
@@ -101,19 +101,13 @@ class SIGMOD_EXPORT Item : public Object
*/
void setName(const QString& name);
/**
- * Sets whether the item is can be sold or not. If set to \p true, the item can be sold at a \link Store store \endlink.
- *
- * \param sellable Whether the item can be sold or not.
- */
- void setSellable(const bool sellable);
- /**
* Sets the \link ItemType type \endlink of the item.
*
* \param type The id of the type the item is.
*/
void setType(const int type);
/**
- * Sets how much the item is sold for at a \link Store store \endlink.
+ * Sets how much the item is sold for at a \link Store store \endlink. If set to -1, it cannot be sold.
*
* \param price The price of the item.
*/
@@ -160,12 +154,6 @@ class SIGMOD_EXPORT Item : public Object
*/
QString name() const;
/**
- * \sa setSellable
- *
- * \return \p true if the item can be sold at a store, \p false otherwise.
- */
- bool sellable() const;
- /**
* \sa setType
*
* \return The id of the \link ItemType type \endlink of the item.
@@ -203,7 +191,6 @@ class SIGMOD_EXPORT Item : public Object
Sigcore::Script script() const;
bool nameCheck(const QString& name) const;
- bool sellableCheck(const bool sellable) const;
bool typeCheck(const int type) const;
bool priceCheck(const int price) const;
bool sellPriceCheck(const int sellPrice) const;
@@ -214,7 +201,6 @@ class SIGMOD_EXPORT Item : public Object
Item& operator=(const Item& rhs);
private:
QString m_name;
- bool m_sellable;
int m_type;
int m_price;
int m_sellPrice;