summaryrefslogtreecommitdiffstats
path: root/pokemod/CoinListObject.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-02-01 20:21:10 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-02-01 20:21:10 +0000
commit91df1e8e35656314a8f6574521f1804d926bddbb (patch)
tree84e941b992fcdf35d0c7460fa7c84223a8422958 /pokemod/CoinListObject.cpp
parent743f74512606cb24fae199dd45cf1a53837b4d16 (diff)
downloadsigen-91df1e8e35656314a8f6574521f1804d926bddbb.tar.gz
sigen-91df1e8e35656314a8f6574521f1804d926bddbb.tar.xz
sigen-91df1e8e35656314a8f6574521f1804d926bddbb.zip
[FIX] Only committed general last time
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@55 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/CoinListObject.cpp')
-rw-r--r--pokemod/CoinListObject.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/pokemod/CoinListObject.cpp b/pokemod/CoinListObject.cpp
index f3c48388..6327001b 100644
--- a/pokemod/CoinListObject.cpp
+++ b/pokemod/CoinListObject.cpp
@@ -25,22 +25,22 @@
const QStringList CoinListObject::TypeStr = QStringList() << "Item" << "Pokémon";
-CoinListObject::CoinListObject(const Pokemod& par, const unsigned _id) :
+CoinListObject::CoinListObject(const Pokemod& par, const int _id) :
Object("CoinListObject", par, _id),
type(Item),
- object(UINT_MAX),
+ object(-1),
amount(1),
cost(0)
{
}
-CoinListObject::CoinListObject(const Pokemod& par, const CoinListObject& o, const unsigned _id) :
+CoinListObject::CoinListObject(const Pokemod& par, const CoinListObject& o, const int _id) :
Object("CoinListObject", par, _id)
{
*this = o;
}
-CoinListObject::CoinListObject(const Pokemod& par, const QString& fname, const unsigned _id) :
+CoinListObject::CoinListObject(const Pokemod& par, const QString& fname, const int _id) :
Object("CoinListObject", par, _id)
{
load(fname, _id);
@@ -52,15 +52,15 @@ bool CoinListObject::validate() const
pokemod.validationMsg(QString("------Object with id %1---").arg(id), Pokemod::V_Msg);
if (type == Item)
{
- if (pokemod.getItemIndex(object) == UINT_MAX)
+ if (pokemod.getItemIndex(object) == -1)
{
pokemod.validationMsg("Invalid item");
valid = false;
}
}
- else if (type == Pokemon)
+ else if (type == Species)
{
- if (pokemod.getSpeciesIndex(object) == UINT_MAX)
+ if (pokemod.getSpeciesIndex(object) == -1)
{
pokemod.validationMsg("Invalid Species");
valid = false;
@@ -71,7 +71,7 @@ bool CoinListObject::validate() const
pokemod.validationMsg("Invalid type");
valid = false;
}
- if (!amount || ((1 < amount) && (type == Pokemon)))
+ if (!amount || ((1 < amount) && (type == Species)))
{
pokemod.validationMsg("Invalid amount");
valid = false;
@@ -79,10 +79,10 @@ bool CoinListObject::validate() const
return valid;
}
-void CoinListObject::load(const QString& fname, const unsigned _id) throw(Exception)
+void CoinListObject::load(const QString& fname, const int _id) throw(Exception)
{
Ini ini(fname);
- if (_id == UINT_MAX)
+ if (_id == -1)
ini.getValue("id", id);
else
id = _id;
@@ -103,49 +103,49 @@ void CoinListObject::save(const QString& coinList) const throw(Exception)
ini.save(QString("%1/coinlist/%2/item/%3.pini").arg(pokemod.getPath()).arg(coinList).arg(id));
}
-void CoinListObject::setType(const unsigned t) throw(BoundsException)
+void CoinListObject::setType(const int t) throw(BoundsException)
{
if (End <= t)
throw(BoundsException(className, "type"));
type = t;
- object = UINT_MAX;
+ object = -1;
}
-void CoinListObject::setObject(const unsigned o) throw(BoundsException)
+void CoinListObject::setObject(const int o) throw(BoundsException)
{
- if (((type == Item) && (pokemod.getItemIndex(object) == UINT_MAX)) || ((type == Pokemon) && (pokemod.getSpeciesIndex(object) == UINT_MAX)))
+ if (((type == Item) && (pokemod.getItemIndex(object) == -1)) || ((type == Species) && (pokemod.getSpeciesIndex(object) == -1)))
throw(BoundsException(className, "object"));
object = o;
}
-void CoinListObject::setAmount(const unsigned a) throw(BoundsException)
+void CoinListObject::setAmount(const int a) throw(BoundsException)
{
if (!a)
throw(BoundsException(className, "amount"));
amount = a;
}
-void CoinListObject::setCost(const unsigned c)
+void CoinListObject::setCost(const int c)
{
cost = c;
}
-unsigned CoinListObject::getType() const
+int CoinListObject::getType() const
{
return type;
}
-unsigned CoinListObject::getObject() const
+int CoinListObject::getObject() const
{
return object;
}
-unsigned CoinListObject::getAmount() const
+int CoinListObject::getAmount() const
{
return amount;
}
-unsigned CoinListObject::getCost() const
+int CoinListObject::getCost() const
{
return cost;
}