diff options
Diffstat (limited to 'pokemod/MapEffect.cpp')
| -rw-r--r-- | pokemod/MapEffect.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/pokemod/MapEffect.cpp b/pokemod/MapEffect.cpp index e731a2af..5685bfcc 100644 --- a/pokemod/MapEffect.cpp +++ b/pokemod/MapEffect.cpp @@ -27,29 +27,29 @@ 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 unsigned _id) : +MapEffect::MapEffect(const Pokemod& par, const int _id) : Object("MapEffect", par, _id), name(""), coordinate(0, 0), existFlag(0, 0), skin(""), - effect(UINT_MAX), - val1(UINT_MAX), - val2(UINT_MAX), - direction(UINT_MAX), + effect(-1), + val1(-1), + val2(-1), + direction(-1), isGhost(false), canMove(false), - dialog(UINT_MAX) + dialog(-1) { } -MapEffect::MapEffect(const Pokemod& par, const MapEffect& e, const unsigned _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 unsigned _id) : +MapEffect::MapEffect(const Pokemod& par, const QString& fname, const int _id) : Object("MapEffect", par, _id) { load(fname, _id); @@ -80,7 +80,7 @@ bool MapEffect::validate() const switch (effect) { case E_Item: - if (pokemod.getItemIndex(val2) == UINT_MAX) + if (pokemod.getItemIndex(val2) == -1) ok = false; break; case E_PC: @@ -109,7 +109,7 @@ bool MapEffect::validate() const pokemod.validationMsg("Invalid driection"); valid = false; } - if (pokemod.getDialogIndex(dialog) == UINT_MAX) + if (pokemod.getDialogIndex(dialog) == -1) { pokemod.validationMsg("Invalid dialog"); valid = false; @@ -117,15 +117,15 @@ bool MapEffect::validate() const return valid; } -void MapEffect::load(const QString& fname, const unsigned _id) throw(Exception) +void MapEffect::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; - unsigned i; - unsigned j; + int i; + int j; ini.getValue("name", name); ini.getValue("coordinate-x", i, 0); ini.getValue("coordinate-y", j, 0); @@ -168,32 +168,32 @@ void MapEffect::setName(const QString& n) name = n; } -void MapEffect::setCoordinate(const unsigned x, const unsigned y) +void MapEffect::setCoordinate(const int x, const int y) { coordinate.set(x, y); } -void MapEffect::setCoordinateX(const unsigned x) +void MapEffect::setCoordinateX(const int x) { coordinate.setX(x); } -void MapEffect::setCoordinateY(const unsigned y) +void MapEffect::setCoordinateY(const int y) { coordinate.setY(y); } -void MapEffect::setExistFlag(const unsigned f, const unsigned s) +void MapEffect::setExistFlag(const int f, const int s) { existFlag.set(f, s); } -void MapEffect::setExistFlagFlag(const unsigned f) +void MapEffect::setExistFlagFlag(const int f) { existFlag.setFlag(f); } -void MapEffect::setExistFlagStatus(const unsigned s) +void MapEffect::setExistFlagStatus(const int s) { existFlag.setStatus(s); } @@ -205,28 +205,28 @@ void MapEffect::setSkin(const QString& s) throw(Exception) skin = s; } -void MapEffect::setEffect(const unsigned e) throw(BoundsException) +void MapEffect::setEffect(const int e) throw(BoundsException) { if (E_End <= e) throw(BoundsException(className, "effect")); effect = e; - val1 = UINT_MAX; - val2 = UINT_MAX; + val1 = -1; + val2 = -1; } -void MapEffect::setVal1(const unsigned v1) throw(UnusedException) +void MapEffect::setVal1(const int v1) throw(UnusedException) { if ((effect != E_StrengthBlock) && (effect != E_Button)) throw(UnusedException(className, "val1")); val1 = v1; } -void MapEffect::setVal2(const unsigned v2) throw(Exception) +void MapEffect::setVal2(const int v2) throw(Exception) { switch (effect) { case E_Item: - if (pokemod.getItemIndex(val2) == UINT_MAX) + if (pokemod.getItemIndex(val2) == -1) throw(BoundsException(className, "val2")); break; case E_PC: @@ -245,7 +245,7 @@ void MapEffect::setVal2(const unsigned v2) throw(Exception) val2 = v2; } -void MapEffect::setDirection(const unsigned d) throw(BoundsException) +void MapEffect::setDirection(const int d) throw(BoundsException) { if (D_End_None <= d) throw(BoundsException(className, "direction")); @@ -262,9 +262,9 @@ void MapEffect::setCanMove(const bool c) canMove = c; } -void MapEffect::setDialog(const unsigned d) throw(BoundsException) +void MapEffect::setDialog(const int d) throw(BoundsException) { - if (pokemod.getDialogIndex(d) == UINT_MAX) + if (pokemod.getDialogIndex(d) == -1) throw(BoundsException(className, "dialog")); dialog = d; } @@ -289,22 +289,22 @@ QString MapEffect::getSkin() const return skin; } -unsigned MapEffect::getEffect() const +int MapEffect::getEffect() const { return effect; } -unsigned MapEffect::getVal1() const +int MapEffect::getVal1() const { return val1; } -unsigned MapEffect::getVal2() const +int MapEffect::getVal2() const { return val2; } -unsigned MapEffect::getDirection() const +int MapEffect::getDirection() const { return direction; } @@ -319,7 +319,7 @@ bool MapEffect::getCanMove() const return canMove; } -unsigned MapEffect::getDialog() const +int MapEffect::getDialog() const { return dialog; } |
