diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-02-19 02:04:07 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-02-19 02:04:07 +0000 |
| commit | a47a7aa7508e18292ace9299692f0e197d7a915a (patch) | |
| tree | 59ce3711fb4252caf298054e99149813bec147e4 /pokemod/MapEffect.cpp | |
| parent | 95b265b8838a29e4d923582b07d51f5eed2bb03f (diff) | |
| download | sigen-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/MapEffect.cpp')
| -rw-r--r-- | pokemod/MapEffect.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/pokemod/MapEffect.cpp b/pokemod/MapEffect.cpp index 5685bfcc..c7c2c1c1 100644 --- a/pokemod/MapEffect.cpp +++ b/pokemod/MapEffect.cpp @@ -27,7 +27,7 @@ const QStringList MapEffect::MapEffectStr = QStringList() << "Item" << "PC" << "Strength Block" << "Button" << "Slot Machine" << "Card Flip Game"; const QStringList MapEffect::PCTypeStr = QStringList() << "Item" << "Pokémon" << "PokéDex" << "Hall of Fame" << "All"; -MapEffect::MapEffect(const Pokemod& par, const int _id) : +MapEffect::MapEffect(const Pokemod* par, const int _id) : Object("MapEffect", par, _id), name(""), coordinate(0, 0), @@ -43,13 +43,13 @@ MapEffect::MapEffect(const Pokemod& par, const int _id) : { } -MapEffect::MapEffect(const Pokemod& par, const MapEffect& e, const int _id) : +MapEffect::MapEffect(const Pokemod* par, const MapEffect& e, const int _id) : Object("MapEffect", par, _id) { *this = e; } -MapEffect::MapEffect(const Pokemod& par, const QString& fname, const int _id) : +MapEffect::MapEffect(const Pokemod* par, const QString& fname, const int _id) : Object("MapEffect", par, _id) { load(fname, _id); @@ -58,20 +58,20 @@ MapEffect::MapEffect(const Pokemod& par, const QString& fname, const int _id) : bool MapEffect::validate() const { bool valid = true; - pokemod.validationMsg(QString("------Effect \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg); + pokemod->validationMsg(QString("------Effect \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg); if (name == "") { - pokemod.validationMsg("Name is not defined"); + pokemod->validationMsg("Name is not defined"); valid = false; } if (Flag::End <= existFlag.getStatus()) { - pokemod.validationMsg("Invalid existence flag status"); + pokemod->validationMsg("Invalid existence flag status"); valid = false; } - if (!QFile::exists(QString("%1/image/skin/%2.png").arg(pokemod.getPath()).arg(skin))) + if (!QFile::exists(QString("%1/image/skin/%2.png").arg(pokemod->getPath()).arg(skin))) { - pokemod.validationMsg(QString("Skin not found")); + pokemod->validationMsg(QString("Skin not found")); valid = false; } if (effect < E_End) @@ -80,7 +80,7 @@ bool MapEffect::validate() const switch (effect) { case E_Item: - if (pokemod.getItemIndex(val2) == -1) + if (pokemod->getItemIndex(val2) == -1) ok = false; break; case E_PC: @@ -95,23 +95,23 @@ bool MapEffect::validate() const } if (!ok) { - pokemod.validationMsg("Invalid val2"); + pokemod->validationMsg("Invalid val2"); valid = false; } } else { - pokemod.validationMsg("Invalid effect"); + pokemod->validationMsg("Invalid effect"); valid = false; } if (D_End_None <= direction) { - pokemod.validationMsg("Invalid driection"); + pokemod->validationMsg("Invalid driection"); valid = false; } - if (pokemod.getDialogIndex(dialog) == -1) + if (pokemod->getDialogIndex(dialog) == -1) { - pokemod.validationMsg("Invalid dialog"); + pokemod->validationMsg("Invalid dialog"); valid = false; } return valid; @@ -160,7 +160,7 @@ void MapEffect::save(const QString& map) const throw(Exception) ini.addField("isGhost", isGhost); ini.addField("canMove", canMove); ini.addField("dialog", dialog); - ini.save(QString("%1/map/%2/effect/%3.pini").arg(pokemod.getPath()).arg(map).arg(name)); + ini.save(QString("%1/map/%2/effect/%3.pini").arg(pokemod->getPath()).arg(map).arg(name)); } void MapEffect::setName(const QString& n) @@ -200,7 +200,7 @@ void MapEffect::setExistFlagStatus(const int s) void MapEffect::setSkin(const QString& s) throw(Exception) { - if (!QFile::exists(QString("%1/image/skin/%2.png").arg(pokemod.getPath()).arg(s))) + if (!QFile::exists(QString("%1/image/skin/%2.png").arg(pokemod->getPath()).arg(s))) throw(Exception(className, "skin does not exist")); skin = s; } @@ -226,7 +226,7 @@ void MapEffect::setVal2(const int v2) throw(Exception) switch (effect) { case E_Item: - if (pokemod.getItemIndex(val2) == -1) + if (pokemod->getItemIndex(val2) == -1) throw(BoundsException(className, "val2")); break; case E_PC: @@ -264,7 +264,7 @@ void MapEffect::setCanMove(const bool c) void MapEffect::setDialog(const int d) throw(BoundsException) { - if (pokemod.getDialogIndex(d) == -1) + if (pokemod->getDialogIndex(d) == -1) throw(BoundsException(className, "dialog")); dialog = d; } |
