diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2008-02-01 20:21:10 +0000 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2008-02-01 20:21:10 +0000 |
commit | 91df1e8e35656314a8f6574521f1804d926bddbb (patch) | |
tree | 84e941b992fcdf35d0c7460fa7c84223a8422958 /pokemod/MapWarp.cpp | |
parent | 743f74512606cb24fae199dd45cf1a53837b4d16 (diff) | |
download | sigen-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/MapWarp.cpp')
-rw-r--r-- | pokemod/MapWarp.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp index 315f92a6..d6246fb4 100644 --- a/pokemod/MapWarp.cpp +++ b/pokemod/MapWarp.cpp @@ -27,31 +27,31 @@ const QStringList MapWarp::TypeStr = QStringList() << "Door/Stair" << "Warp Pad" << "Hole" << "Boundary"; -MapWarp::MapWarp(const Pokemod& par, const unsigned _id) : +MapWarp::MapWarp(const Pokemod& par, const int _id) : Object("MapWarp", par, _id), name(""), coordinate(0, 0), - directionOut(UINT_MAX), - warpType(UINT_MAX), + directionOut(-1), + warpType(-1), isBiking(false), isFlash(false), isFoggy(false), - toMap(UINT_MAX), - toWarp(UINT_MAX), + toMap(-1), + toWarp(-1), workingFlag(0, 0), - dialog(UINT_MAX) + dialog(-1) { - for (unsigned i = 0; i < D_End; ++i) + for (int i = 0; i < D_End; ++i) from[i] = false; } -MapWarp::MapWarp(const Pokemod& par, const MapWarp& w, const unsigned _id) : +MapWarp::MapWarp(const Pokemod& par, const MapWarp& w, const int _id) : Object("MapWarp", par, _id) { *this = w; } -MapWarp::MapWarp(const Pokemod& par, const QString& fname, const unsigned _id) : +MapWarp::MapWarp(const Pokemod& par, const QString& fname, const int _id) : Object("MapWarp", par, _id) { load(fname, _id); @@ -81,20 +81,20 @@ bool MapWarp::validate() const pokemod.validationMsg("Invalid type"); valid = false; } - if (pokemod.getMapIndex(toMap) == UINT_MAX) + if (pokemod.getMapIndex(toMap) == -1) { pokemod.validationMsg("Invalid destination map"); valid = false; } else { - if (pokemod.getMapByID(toMap).getWarpIndex(toWarp) == UINT_MAX) + if (pokemod.getMapByID(toMap).getWarpIndex(toWarp) == -1) { pokemod.validationMsg("Invalid destnation warp"); valid = false; } } - if (pokemod.getDialogIndex(dialog) == UINT_MAX) + if (pokemod.getDialogIndex(dialog) == -1) { pokemod.validationMsg("Invalid dialog"); valid = false; @@ -102,15 +102,15 @@ bool MapWarp::validate() const return valid; } -void MapWarp::load(const QString& fname, const unsigned _id) throw(Exception) +void MapWarp::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); @@ -160,36 +160,36 @@ void MapWarp::setName(const QString& n) name = n; } -void MapWarp::setCoordinate(const unsigned x, const unsigned y) +void MapWarp::setCoordinate(const int x, const int y) { coordinate.set(x, y); } -void MapWarp::setCoordinateX(const unsigned x) +void MapWarp::setCoordinateX(const int x) { coordinate.setX(x); } -void MapWarp::setCoordinateY(const unsigned y) +void MapWarp::setCoordinateY(const int y) { coordinate.setY(y); } -void MapWarp::setFrom(const unsigned d, const bool f) throw(BoundsException) +void MapWarp::setFrom(const int d, const bool f) throw(BoundsException) { if (D_End <= d) throw(BoundsException(className, "direction")); from[d] = f; } -void MapWarp::setDirectionOut(const unsigned d) throw(BoundsException) +void MapWarp::setDirectionOut(const int d) throw(BoundsException) { if (D_End <= d) throw(BoundsException(className, "direction")); directionOut = d; } -void MapWarp::setWarpType(const unsigned w) throw(BoundsException) +void MapWarp::setWarpType(const int w) throw(BoundsException) { if (End <= w) throw(BoundsException(className, "warpType")); @@ -211,40 +211,40 @@ void MapWarp::setIsFoggy(const bool i) isFoggy = i; } -void MapWarp::setToMap(const unsigned t) throw(BoundsException) +void MapWarp::setToMap(const int t) throw(BoundsException) { - if (pokemod.getMapIndex(t) == UINT_MAX) + if (pokemod.getMapIndex(t) == -1) throw(BoundsException(className, "toMap")); toMap = t; - toWarp = UINT_MAX; + toWarp = -1; } -void MapWarp::setToWarp(const unsigned t) throw(BoundsException) +void MapWarp::setToWarp(const int t) throw(BoundsException) { - if (pokemod.getMapIndex(toMap) == UINT_MAX) + if (pokemod.getMapIndex(toMap) == -1) throw(BoundsException(className, "toMap")); - if (pokemod.getMapByID(toMap).getWarpIndex(t) == UINT_MAX) + if (pokemod.getMapByID(toMap).getWarpIndex(t) == -1) throw(BoundsException(className, "toWarp")); } -void MapWarp::setWorkingFlag(const unsigned f, const unsigned s) +void MapWarp::setWorkingFlag(const int f, const int s) { workingFlag.set(f, s); } -void MapWarp::setWorkingFlagFlag(const unsigned f) +void MapWarp::setWorkingFlagFlag(const int f) { workingFlag.setFlag(f); } -void MapWarp::setWorkingFlagStatus(const unsigned s) +void MapWarp::setWorkingFlagStatus(const int s) { workingFlag.setStatus(s); } -void MapWarp::setDialog(const unsigned d) throw(BoundsException) +void MapWarp::setDialog(const int d) throw(BoundsException) { - if (pokemod.getDialogIndex(d) == UINT_MAX) + if (pokemod.getDialogIndex(d) == -1) throw(BoundsException(className, "dialog")); dialog = d; } @@ -259,19 +259,19 @@ Point MapWarp::getCoordinate() const return coordinate; } -bool MapWarp::getFrom(const unsigned d) const throw(BoundsException) +bool MapWarp::getFrom(const int d) const throw(BoundsException) { if (D_End <= d) throw(BoundsException(className, "direction")); return from[d]; } -unsigned MapWarp::getDirectionOut() const +int MapWarp::getDirectionOut() const { return directionOut; } -unsigned MapWarp::getWarpType() const +int MapWarp::getWarpType() const { return warpType; } @@ -291,12 +291,12 @@ bool MapWarp::getIsFoggy() const return isFoggy; } -unsigned MapWarp::getToMap() const +int MapWarp::getToMap() const { return toMap; } -unsigned MapWarp::getToWarp() const +int MapWarp::getToWarp() const { return toWarp; } @@ -306,7 +306,7 @@ Flag MapWarp::getWorkingFlag() const return workingFlag; } -unsigned MapWarp::getDialog() const +int MapWarp::getDialog() const { return dialog; } @@ -317,7 +317,7 @@ MapWarp& MapWarp::operator=(const MapWarp& rhs) return *this; name = rhs.name; coordinate = rhs.coordinate; - for (unsigned i = 0; i < D_End; ++i) + for (int i = 0; i < D_End; ++i) from[i] = rhs.from[i]; directionOut = rhs.directionOut; warpType = rhs.warpType; |