diff options
Diffstat (limited to 'pokemod/MapWarp.cpp')
-rw-r--r-- | pokemod/MapWarp.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp index 1cc17994..35d56de7 100644 --- a/pokemod/MapWarp.cpp +++ b/pokemod/MapWarp.cpp @@ -41,7 +41,7 @@ MapWarp::MapWarp(const Pokemod* par, const int _id) : workingFlag(0, 0), dialog(-1) { - for (int i = 0; i < D_End; ++i) + for (int i = 0; i < Pokemod::D_End; ++i) from[i] = false; } @@ -66,12 +66,12 @@ bool MapWarp::validate() const pokemod->validationMsg("Name is not defined"); valid = false; } - if (!from[D_Up] && !from[D_Down] && !from[D_Left] && !from[D_Right]) + if (!from[Pokemod::D_Up] && !from[Pokemod::D_Down] && !from[Pokemod::D_Left] && !from[Pokemod::D_Right]) { pokemod->validationMsg("No access from any direction"); valid = false; } - if (D_End_None <= directionOut) + if (Pokemod::D_End_None <= directionOut) { pokemod->validationMsg("Invalid direction out"); valid = false; @@ -115,10 +115,10 @@ void MapWarp::load(const QString& fname, const int _id) throw(Exception) ini.getValue("coordinate-x", i, 0); ini.getValue("coordinate-y", j, 0); coordinate.set(i, j); - ini.getValue("from-up", from[D_Up], false); - ini.getValue("from-down", from[D_Down], false); - ini.getValue("from-left", from[D_Left], false); - ini.getValue("from-right", from[D_Right], false); + ini.getValue("from-up", from[Pokemod::D_Up], false); + ini.getValue("from-down", from[Pokemod::D_Down], false); + ini.getValue("from-left", from[Pokemod::D_Left], false); + ini.getValue("from-right", from[Pokemod::D_Right], false); ini.getValue("directionOut", directionOut); ini.getValue("warpType", warpType); ini.getValue("isBiking", isBiking, false); @@ -138,10 +138,10 @@ void MapWarp::save(const QString& map) const throw(Exception) ini.addField("id", id); ini.addField("coordinate-x", coordinate.getX()); ini.addField("coordinate-y", coordinate.getY()); - ini.addField("from-up", from[D_Up]); - ini.addField("from-down", from[D_Down]); - ini.addField("from-left", from[D_Left]); - ini.addField("from-right", from[D_Right]); + ini.addField("from-up", from[Pokemod::D_Up]); + ini.addField("from-down", from[Pokemod::D_Down]); + ini.addField("from-left", from[Pokemod::D_Left]); + ini.addField("from-right", from[Pokemod::D_Right]); ini.addField("directionOut", directionOut); ini.addField("warpType", warpType); ini.addField("isBiking", isBiking); @@ -177,14 +177,14 @@ void MapWarp::setCoordinateY(const int y) void MapWarp::setFrom(const int d, const bool f) throw(BoundsException) { - if (D_End <= d) + if (Pokemod::D_End <= d) throw(BoundsException(className, "direction")); from[d] = f; } void MapWarp::setDirectionOut(const int d) throw(BoundsException) { - if (D_End <= d) + if (Pokemod::D_End <= d) throw(BoundsException(className, "direction")); directionOut = d; } @@ -267,7 +267,7 @@ Point MapWarp::getCoordinate() const bool MapWarp::getFrom(const int d) const throw(BoundsException) { - if (D_End <= d) + if (Pokemod::D_End <= d) throw(BoundsException(className, "direction")); return from[d]; } @@ -323,7 +323,7 @@ MapWarp& MapWarp::operator=(const MapWarp& rhs) return *this; name = rhs.name; coordinate = rhs.coordinate; - for (int i = 0; i < D_End; ++i) + for (int i = 0; i < Pokemod::D_End; ++i) from[i] = rhs.from[i]; directionOut = rhs.directionOut; warpType = rhs.warpType; |