summaryrefslogtreecommitdiffstats
path: root/pokemod/CoinListObject.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-02-19 02:04:07 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-02-19 02:04:07 +0000
commita47a7aa7508e18292ace9299692f0e197d7a915a (patch)
tree59ce3711fb4252caf298054e99149813bec147e4 /pokemod/CoinListObject.cpp
parent95b265b8838a29e4d923582b07d51f5eed2bb03f (diff)
downloadsigen-a47a7aa7508e18292ace9299692f0e197d7a915a.tar.gz
sigen-a47a7aa7508e18292ace9299692f0e197d7a915a.tar.xz
sigen-a47a7aa7508e18292ace9299692f0e197d7a915a.zip
[FIX] pokemod now passes pointers around instead of references
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@61 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/CoinListObject.cpp')
-rw-r--r--pokemod/CoinListObject.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/pokemod/CoinListObject.cpp b/pokemod/CoinListObject.cpp
index b5fe3726..143c3db1 100644
--- a/pokemod/CoinListObject.cpp
+++ b/pokemod/CoinListObject.cpp
@@ -25,7 +25,7 @@
const QStringList CoinListObject::TypeStr = QStringList() << "Item" << "Pokémon";
-CoinListObject::CoinListObject(const Pokemod& par, const int _id) :
+CoinListObject::CoinListObject(const Pokemod* par, const int _id) :
Object("CoinListObject", par, _id),
type(Item),
object(-1),
@@ -34,13 +34,13 @@ CoinListObject::CoinListObject(const Pokemod& par, const int _id) :
{
}
-CoinListObject::CoinListObject(const Pokemod& par, const CoinListObject& o, const int _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 int _id) :
+CoinListObject::CoinListObject(const Pokemod* par, const QString& fname, const int _id) :
Object("CoinListObject", par, _id)
{
load(fname, _id);
@@ -49,31 +49,31 @@ CoinListObject::CoinListObject(const Pokemod& par, const QString& fname, const i
bool CoinListObject::validate() const
{
bool valid = true;
- pokemod.validationMsg(QString("------Object with id %1---").arg(id), Pokemod::V_Msg);
+ pokemod->validationMsg(QString("------Object with id %1---").arg(id), Pokemod::V_Msg);
if (type == Item)
{
- if (pokemod.getItemIndex(object) == -1)
+ if (pokemod->getItemIndex(object) == -1)
{
- pokemod.validationMsg("Invalid item");
+ pokemod->validationMsg("Invalid item");
valid = false;
}
}
else if (type == Species)
{
- if (pokemod.getSpeciesIndex(object) == -1)
+ if (pokemod->getSpeciesIndex(object) == -1)
{
- pokemod.validationMsg("Invalid Species");
+ pokemod->validationMsg("Invalid Species");
valid = false;
}
}
else
{
- pokemod.validationMsg("Invalid type");
+ pokemod->validationMsg("Invalid type");
valid = false;
}
if (!amount || ((1 < amount) && (type == Species)))
{
- pokemod.validationMsg("Invalid amount");
+ pokemod->validationMsg("Invalid amount");
valid = false;
}
return valid;
@@ -100,7 +100,7 @@ void CoinListObject::save(const QString& coinList) const throw(Exception)
ini.addField("object", object);
ini.addField("amount", amount);
ini.addField("cost", cost);
- ini.save(QString("%1/coinlist/%2/item/%3.pini").arg(pokemod.getPath()).arg(coinList).arg(id));
+ ini.save(QString("%1/coinlist/%2/item/%3.pini").arg(pokemod->getPath()).arg(coinList).arg(id));
}
void CoinListObject::setType(const int t) throw(BoundsException)
@@ -113,7 +113,7 @@ void CoinListObject::setType(const int t) throw(BoundsException)
void CoinListObject::setObject(const int o) throw(BoundsException)
{
- if (((type == Item) && (pokemod.getItemIndex(o) == -1)) || ((type == Species) && (pokemod.getSpeciesIndex(o) == -1)))
+ if (((type == Item) && (pokemod->getItemIndex(o) == -1)) || ((type == Species) && (pokemod->getSpeciesIndex(o) == -1)))
throw(BoundsException(className, "object"));
object = o;
}