summaryrefslogtreecommitdiffstats
path: root/pokemod/MapWarp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/MapWarp.cpp')
-rw-r--r--pokemod/MapWarp.cpp854
1 files changed, 356 insertions, 498 deletions
diff --git a/pokemod/MapWarp.cpp b/pokemod/MapWarp.cpp
index 81878de7..9864ea19 100644
--- a/pokemod/MapWarp.cpp
+++ b/pokemod/MapWarp.cpp
@@ -1,498 +1,356 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemod/MapWarp.cpp
-// Purpose: Define a warp for a map
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Fri June 1 2007 20:46:23
-// Copyright: ©2007 Nerdy Productions
-// Licence:
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program. If not, see <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "MapWarp.h"
-
-PokeGen::PokeMod::MapWarp::MapWarp(const Pokemod *par, const unsigned _id) :
- name(""),
- coordinate(0, 0),
- fromUp(false),
- fromDown(false),
- fromLeft(false),
- fromRight(false),
- directionOut(UINT_MAX),
- warpType(UINT_MAX),
- isBiking(false),
- isFlash(false),
- isFoggy(false),
- toMap(UINT_MAX),
- toWarp(UINT_MAX),
- workingFlag(0, 0),
- dialog(UINT_MAX)
-{
- LogCtor("MapWarp", _id);
- id = _id;
- pokemod = par;
-}
-
-PokeGen::PokeMod::MapWarp::MapWarp(const Pokemod *par, Ini &ini, const unsigned _id)
-{
- LogCtorIni("MapWarp", _id);
- pokemod = par;
- ImportIni(ini, _id);
- if (id == UINT_MAX)
- LogIdError("MapWarp");
-}
-
-PokeGen::PokeMod::MapWarp::~MapWarp()
-{
- LogDtor("MapWarp", id, name);
-}
-
-void PokeGen::PokeMod::MapWarp::Validate()
-{
- LogValidateStart("MapWarp", id, name);
- if (name == "")
- {
- LogVarNotSet("MapWarp", id, "name");
- isValid = false;
- }
- if (!fromUp && !fromDown && !fromLeft && !fromRight)
- {
- LogVarNotSet("MapWarp", id, "directions", name);
- isValid = false;
- }
- if (DIR_END_NONE <= directionOut)
- {
- LogVarNotValid("MapWarp", id, "directionOut", name);
- isValid = false;
- }
- if (WT_END <= warpType)
- {
- LogVarNotValid("MapWarp", id, "warpType", name);
- isValid = false;
- }
- if (const Map *m = pokemod->GetMap(toMap))
- {
- if (!m->GetMapWarp(toWarp))
- {
- LogVarNotValid("MapWarp", id, "toWarp");
- isValid = false;
- }
- }
- else
- {
- LogVarNotValid("MapWarp", id, "toMap");
- isValid = false;
- }
- if (!pokemod->GetDialog(dialog))
- {
- LogVarNotValid("MapWarp", id, "dialog");
- isValid = false;
- }
- LogValidateOver("MapWarp", id, isValid, name);
-}
-
-void PokeGen::PokeMod::MapWarp::ImportIni(Ini &ini, const unsigned _id)
-{
- LogImportStart("MapWarp");
- if (_id == UINT_MAX)
- {
- ini.GetValue("id", id);
- if (id == UINT_MAX)
- LogIdNotFound("MapWarp");
- }
- else
- id = _id;
- unsigned i;
- unsigned j;
- ini.GetValue("name", name);
- ini.GetValue("coordinate-x", i, 0);
- ini.GetValue("coordinate-y", j, 0);
- coordinate.Set(i, j);
- ini.GetValue("fromUp", fromUp, false);
- ini.GetValue("fromDown", fromDown, false);
- ini.GetValue("fromLeft", fromLeft, false);
- ini.GetValue("fromRight", fromRight, false);
- ini.GetValue("directionOut", directionOut);
- ini.GetValue("warpType", warpType);
- ini.GetValue("isBiking", isBiking, false);
- ini.GetValue("isFlash", isFlash, false);
- ini.GetValue("isFoggy", isFoggy, false);
- ini.GetValue("toMap", toMap);
- ini.GetValue("toWarp", toWarp);
- ini.GetValue("workingFlag-f", i, 0);
- ini.GetValue("workingFlag-s", j, 0);
- workingFlag.Set(i, j);
- ini.GetValue("dialog", dialog);
- LogImportOver("MapWarp", id, name);
-}
-
-void PokeGen::PokeMod::MapWarp::ExportIni(QFile &fout, const QString &map) const
-{
- LogExportStart("MapWarp", id, name);
- Ini exMapWarp("mapWarp " + map);
- exMapWarp.AddField("id", id);
- exMapWarp.AddField("coordinate-x", coordinate.GetX());
- exMapWarp.AddField("coordinate-y", coordinate.GetY());
- exMapWarp.AddField("fromUp", fromUp);
- exMapWarp.AddField("fromDown", fromDown);
- exMapWarp.AddField("fromLeft", fromLeft);
- exMapWarp.AddField("fromRight", fromRight);
- exMapWarp.AddField("directionOut", directionOut);
- exMapWarp.AddField("warpType", warpType);
- exMapWarp.AddField("isBiking", isBiking);
- exMapWarp.AddField("isFlash", isFlash);
- exMapWarp.AddField("isFoggy", isFoggy);
- exMapWarp.AddField("toMap", toMap);
- exMapWarp.AddField("toWarp", toWarp);
- exMapWarp.AddField("workingFlag-f", workingFlag.GetFlag());
- exMapWarp.AddField("workingFlag-s", workingFlag.GetStatus());
- exMapWarp.AddField("dialog", dialog);
- exMapWarp.Export(fout);
- LogExportOver("MapWarp", id, name);
-}
-
-void PokeGen::PokeMod::MapWarp::SetName(const QString &n)
-{
- LogSetVar("MapWarp", id, "name", n);
- name = n;
-}
-
-void PokeGen::PokeMod::MapWarp::SetCoordinate(const Point &c)
-{
- LogSetVar("MapWarp", id, "coordinate", c.GetX(), c.GetY(), name);
- coordinate = c;
-}
-
-void PokeGen::PokeMod::MapWarp::SetCoordinate(const unsigned x, const unsigned y)
-{
- LogSetVar("MapWarp", id, "coordinate", x, y, name);
- coordinate.Set(x, y);
-}
-
-void PokeGen::PokeMod::MapWarp::SetCoordinateX(const unsigned x)
-{
- LogSetVar("MapWarp", id, "coordinate x", x, name);
- coordinate.SetX(x);
-}
-
-void PokeGen::PokeMod::MapWarp::SetCoordinateY(const unsigned y)
-{
- LogSetVar("MapWarp", id, "coordinate y", y, name);
- coordinate.SetY(y);
-}
-
-void PokeGen::PokeMod::MapWarp::SetFromUp(const bool f)
-{
- LogSetVar("MapWarp", id, "fromUp", f, name);
- fromUp = f;
-}
-
-void PokeGen::PokeMod::MapWarp::SetFromDown(const bool f)
-{
- LogSetVar("MapWarp", id, "fromDown", f, name);
- fromDown = f;
-}
-
-void PokeGen::PokeMod::MapWarp::SetFromLeft(const bool f)
-{
- LogSetVar("MapWarp", id, "fromLeft", f, name);
- fromLeft = f;
-}
-
-void PokeGen::PokeMod::MapWarp::SetFromRight(const bool f)
-{
- LogSetVar("MapWarp", id, "fromRight", f, name);
- fromRight = f;
-}
-
-void PokeGen::PokeMod::MapWarp::SetDirectionOut(const unsigned d)
-{
- LogSetVar("MapWarp", id, "directionOut", d, name);
- if (d < DIR_END)
- directionOut = d;
-}
-
-void PokeGen::PokeMod::MapWarp::SetDirectionOut(const QString &d)
-{
- SetDirectionOut(FindIn(DIR_END, d, DirectionStr));
-}
-
-void PokeGen::PokeMod::MapWarp::SetWarpType(const unsigned w)
-{
- LogSetVar("MapWarp", id, "warpType", w, name);
- if (w < WT_END)
- warpType = w;
-}
-
-void PokeGen::PokeMod::MapWarp::SetWarpType(const QString &w)
-{
- SetWarpType(FindIn(WT_END, w, WarpTypeStr));
-}
-
-void PokeGen::PokeMod::MapWarp::SetIsBiking(const bool i)
-{
- LogSetVar("MapWarp", id, "isBiking", i, name);
- isBiking = i;
-}
-
-void PokeGen::PokeMod::MapWarp::SetIsFlash(const bool i)
-{
- LogSetVar("MapWarp", id, "isFlash", i, name);
- isFlash = i;
-}
-
-void PokeGen::PokeMod::MapWarp::SetIsFoggy(const bool i)
-{
- LogSetVar("MapWarp", id, "isFoggy", i, name);
- isFoggy = i;
-}
-
-void PokeGen::PokeMod::MapWarp::SetToMap(const unsigned t)
-{
- LogSetVar("MapWarp", id, "toMap", t, name);
- if (pokemod->GetMap(t))
- {
- toMap = t;
- toWarp = UINT_MAX;
- }
-}
-
-void PokeGen::PokeMod::MapWarp::SetToMap(const QString &t)
-{
- LogSetVar("MapWarp", id, "toMap string", t, name);
- if (const Map *m = pokemod->GetMap(t))
- {
- toMap = m->GetId();
- toWarp = UINT_MAX;
- }
-}
-
-void PokeGen::PokeMod::MapWarp::SetToWarp(const unsigned t)
-{
- LogSetVar("MapWarp", id, "toWarp", t, name);
- if (const Map *m = pokemod->GetMap(toMap))
- {
- if (m->GetMapWarp(t))
- toWarp = t;
- }
-}
-
-void PokeGen::PokeMod::MapWarp::SetToWarp(const QString &t)
-{
- LogSetVar("MapWarp", id, "toWarp string", t, name);
- if (const Map *m = pokemod->GetMap(toMap))
- {
- if (const MapWarp *w = m->GetMapWarp(t))
- toWarp = w->GetId();
- }
-}
-
-void PokeGen::PokeMod::MapWarp::SetWorkingFlag(const Flag &w)
-{
- LogSetVar("MapWarp", id, "workingFlag", w.GetFlag(), w.GetStatus(), name);
- workingFlag = w;
-}
-
-void PokeGen::PokeMod::MapWarp::SetWorkingFlag(const unsigned f, const unsigned s)
-{
- LogSetVar("MapWarp", id, "workingFlag", f, s, name);
- workingFlag.Set(f, s);
-}
-
-void PokeGen::PokeMod::MapWarp::SetWorkingFlagFlag(const unsigned f)
-{
- LogSetVar("MapWarp", id, "workingFlag flag", f, name);
- workingFlag.SetFlag(f);
-}
-
-void PokeGen::PokeMod::MapWarp::SetWorkingFlagStatus(const unsigned s)
-{
- LogSetVar("MapWarp", id, "workingFlag status", s, name);
- workingFlag.SetStatus(s);
-}
-
-void PokeGen::PokeMod::MapWarp::SetWorkingFlagStatus(const QString &s)
-{
- SetWorkingFlagStatus(FindIn(FV_END, s, FlagValueStr));
-}
-
-void PokeGen::PokeMod::MapWarp::SetDialog(const unsigned d)
-{
- LogSetVar("MapWarp", id, "dialog", d, name);
- if (pokemod->GetDialog(d))
- dialog = d;
-}
-
-QString PokeGen::PokeMod::MapWarp::GetName() const
-{
- LogFetchVar("MapWarp", id, "name", name);
- return name;
-}
-
-PokeGen::PokeMod::Point PokeGen::PokeMod::MapWarp::GetCoordinate() const
-{
- LogFetchVar("MapWarp", id, "coorinate", coordinate.GetX(), coordinate.GetY(), name);
- return coordinate;
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetCoordinateX() const
-{
- LogFetchVar("MapWarp", id, "coordinate x", coordinate.GetX(), name);
- return coordinate.GetX();
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetCoordinateY() const
-{
- LogFetchVar("MapWarp", id, "coordinate y", coordinate.GetY(), name);
- return coordinate.GetY();
-}
-
-bool PokeGen::PokeMod::MapWarp::GetFromUp() const
-{
- LogFetchVar("MapWarp", id, "fromUp", fromUp, name);
- return fromUp;
-}
-
-bool PokeGen::PokeMod::MapWarp::GetFromDown() const
-{
- LogFetchVar("MapWarp", id, "fromDown", fromDown, name);
- return fromDown;
-}
-
-bool PokeGen::PokeMod::MapWarp::GetFromLeft() const
-{
- LogFetchVar("MapWarp", id, "fromLeft", fromLeft, name);
- return fromLeft;
-}
-
-bool PokeGen::PokeMod::MapWarp::GetFromRight() const
-{
- LogFetchVar("MapWarp", id, "fromRight", fromRight, name);
- return fromRight;
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetDirectionOut() const
-{
- LogFetchVar("MapWarp", id, "directionOut", directionOut, name);
- return directionOut;
-}
-
-QString PokeGen::PokeMod::MapWarp::GetDirectionOutString() const
-{
- LogFetchVar("MapWarp", id, "directionOut string", directionOut, name);
- if (directionOut < DIR_END)
- return DirectionStr[directionOut];
- return "";
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetWarpType() const
-{
- LogFetchVar("MapWarp", id, "warpType", warpType, name);
- return warpType;
-}
-
-QString PokeGen::PokeMod::MapWarp::GetWarpTypeString() const
-{
- LogFetchVar("MapWarp", id, "warpType string", warpType, name);
- if (warpType < WT_END)
- return WarpTypeStr[warpType];
- return "";
-}
-
-bool PokeGen::PokeMod::MapWarp::GetIsBiking() const
-{
- LogFetchVar("MapWarp", id, "isBiking", isBiking, name);
- return isBiking;
-}
-
-bool PokeGen::PokeMod::MapWarp::GetIsFlash() const
-{
- LogFetchVar("MapWarp", id, "isFlash", isFlash, name);
- return isFlash;
-}
-
-bool PokeGen::PokeMod::MapWarp::GetIsFoggy() const
-{
- LogFetchVar("MapWarp", id, "isFoggy", isFoggy, name);
- return isFoggy;
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetToMap() const
-{
- LogFetchVar("MapWarp", id, "toMap", toMap, name);
- return toMap;
-}
-
-QString PokeGen::PokeMod::MapWarp::GetToMapString() const
-{
- LogFetchVar("MapWarp", id, "toMap string", toMap, name);
- if (const Map *m = pokemod->GetMap(toMap))
- return m->GetName();
- return "";
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetToWarp() const
-{
- LogFetchVar("MapWarp", id, "toWarp", toWarp, name);
- return toWarp;
-}
-
-QString PokeGen::PokeMod::MapWarp::GetToWarpString() const
-{
- LogFetchVar("MapWarp", id, "toWarp string", toWarp, name);
- if (const Map *m = pokemod->GetMap(toMap))
- {
- if (const MapWarp *w = m->GetMapWarp(toWarp))
- return w->GetName();
- }
- return "";
-}
-
-PokeGen::PokeMod::Flag PokeGen::PokeMod::MapWarp::GetWorkingFlag() const
-{
- LogFetchVar("MapWarp", id, "workingFlag", workingFlag.GetFlag(), workingFlag.GetStatus(), name);
- return workingFlag;
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetWorkingFlagFlag() const
-{
- LogFetchVar("MapWarp", id, "workingFlag flag", workingFlag.GetFlag(), name);
- return workingFlag.GetFlag();
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetWorkingFlagStatus() const
-{
- LogFetchVar("MapWarp", id, "workingFlag status", workingFlag.GetStatus(), name);
- return workingFlag.GetStatus();
-}
-
-QString PokeGen::PokeMod::MapWarp::GetWorkingFlagStatusString() const
-{
- LogFetchVar("MapWarp", id, "workingFlag status string", workingFlag.GetStatus(), name);
- return workingFlag.GetStatusString();
-}
-
-unsigned PokeGen::PokeMod::MapWarp::GetDialog() const
-{
- LogFetchVar("MapWarp", id, "dialog", dialog, name);
- return dialog;
-}
-
-QString PokeGen::PokeMod::MapWarp::GetDialogString() const
-{
- LogFetchVar("MapWarp", id, "dialog string", dialog, name);
- if (const Dialog *d = pokemod->GetDialog(dialog))
- return d->GetDialog();
- return "";
-}
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokemod/MapWarp.cpp
+// Purpose: Define a warp for a map
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Fri June 1 2007 20:46:23
+// Copyright: ©2007 Nerdy Productions
+// Licence:
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MapWarp.h"
+
+PokeGen::PokeMod::MapWarp::MapWarp(const Pokemod* par, const unsigned _id) :
+ Object(_id, par),
+ name(""),
+ coordinate(0, 0),
+ fromUp(false),
+ fromDown(false),
+ fromLeft(false),
+ fromRight(false),
+ directionOut(UINT_MAX),
+ warpType(UINT_MAX),
+ isBiking(false),
+ isFlash(false),
+ isFoggy(false),
+ toMap(UINT_MAX),
+ toWarp(UINT_MAX),
+ workingFlag(0, 0),
+ dialog(UINT_MAX)
+{
+}
+
+PokeGen::PokeMod::MapWarp::MapWarp(const Pokemod* par, Ini& ini, const unsigned _id) :
+ Object(_id, par)
+{
+ ImportIni(ini, _id);
+}
+
+bool PokeGen::PokeMod::MapWarp::Validate()
+{
+ pokemod->ValidationMsg(QString("------Warp \"%1\" with id %2---").arg(name).arg(id), Pokemod::V_Msg);
+ if (name == "")
+ {
+ pokemod->ValidationMsg("Name is not defined");
+ isValid = false;
+ }
+ if (!fromUp && !fromDown && !fromLeft && !fromRight)
+ {
+ pokemod->ValidationMsg("No access from any direction");
+ isValid = false;
+ }
+ if (DIR_End_None <= directionOut)
+ {
+ pokemod->ValidationMsg("Invalid direction out");
+ isValid = false;
+ }
+ if (End <= warpType)
+ {
+ pokemod->ValidationMsg("Invalid type");
+ isValid = false;
+ }
+ if (const Map* m = pokemod->GetMap(toMap))
+ {
+ if (m->GetWarpByID(toWarp) == UINT_MAX)
+ {
+ pokemod->ValidationMsg("Invalid destnation warp");
+ isValid = false;
+ }
+ }
+ else
+ {
+ pokemod->ValidationMsg("Invalid destination map");
+ isValid = false;
+ }
+ if (pokemod->GetDialogByID(dialog) == UINT_MAX)
+ {
+ pokemod->ValidationMsg("Invalid dialog");
+ isValid = false;
+ }
+ return isValid;
+}
+
+void PokeGen::PokeMod::MapWarp::ImportIni(Ini& ini, const unsigned _id)
+{
+ if (_id == UINT_MAX)
+ ini.GetValue("id", id);
+ else
+ id = _id;
+ unsigned i;
+ unsigned j;
+ ini.GetValue("name", name);
+ ini.GetValue("coordinate-x", i, 0);
+ ini.GetValue("coordinate-y", j, 0);
+ coordinate.Set(i, j);
+ ini.GetValue("fromUp", fromUp, false);
+ ini.GetValue("fromDown", fromDown, false);
+ ini.GetValue("fromLeft", fromLeft, false);
+ ini.GetValue("fromRight", fromRight, false);
+ ini.GetValue("directionOut", directionOut);
+ ini.GetValue("warpType", warpType);
+ ini.GetValue("isBiking", isBiking, false);
+ ini.GetValue("isFlash", isFlash, false);
+ ini.GetValue("isFoggy", isFoggy, false);
+ ini.GetValue("toMap", toMap);
+ ini.GetValue("toWarp", toWarp);
+ ini.GetValue("workingFlag-f", i, 0);
+ ini.GetValue("workingFlag-s", j, 0);
+ workingFlag.Set(i, j);
+ ini.GetValue("dialog", dialog);
+}
+
+void PokeGen::PokeMod::MapWarp::ExportIni(QFile& fout, const QString& map) const
+{
+ Ini exMapWarp("mapWarp " + map);
+ exMapWarp.AddField("id", id);
+ exMapWarp.AddField("coordinate-x", coordinate.GetX());
+ exMapWarp.AddField("coordinate-y", coordinate.GetY());
+ exMapWarp.AddField("fromUp", fromUp);
+ exMapWarp.AddField("fromDown", fromDown);
+ exMapWarp.AddField("fromLeft", fromLeft);
+ exMapWarp.AddField("fromRight", fromRight);
+ exMapWarp.AddField("directionOut", directionOut);
+ exMapWarp.AddField("warpType", warpType);
+ exMapWarp.AddField("isBiking", isBiking);
+ exMapWarp.AddField("isFlash", isFlash);
+ exMapWarp.AddField("isFoggy", isFoggy);
+ exMapWarp.AddField("toMap", toMap);
+ exMapWarp.AddField("toWarp", toWarp);
+ exMapWarp.AddField("workingFlag-f", workingFlag.GetFlag());
+ exMapWarp.AddField("workingFlag-s", workingFlag.GetStatus());
+ exMapWarp.AddField("dialog", dialog);
+ exMapWarp.Export(fout);
+}
+
+void PokeGen::PokeMod::MapWarp::SetName(const QString& n)
+{
+ name = n;
+}
+
+void PokeGen::PokeMod::MapWarp::SetCoordinate(const unsigned x, const unsigned y)
+{
+ coordinate.Set(x, y);
+}
+
+void PokeGen::PokeMod::MapWarp::SetCoordinateX(const unsigned x)
+{
+ coordinate.SetX(x);
+}
+
+void PokeGen::PokeMod::MapWarp::SetCoordinateY(const unsigned y)
+{
+ coordinate.SetY(y);
+}
+
+void PokeGen::PokeMod::MapWarp::SetFromUp(const bool f)
+{
+ fromUp = f;
+}
+
+void PokeGen::PokeMod::MapWarp::SetFromDown(const bool f)
+{
+ fromDown = f;
+}
+
+void PokeGen::PokeMod::MapWarp::SetFromLeft(const bool f)
+{
+ fromLeft = f;
+}
+
+void PokeGen::PokeMod::MapWarp::SetFromRight(const bool f)
+{
+ fromRight = f;
+}
+
+bool PokeGen::PokeMod::MapWarp::SetDirectionOut(const unsigned d)
+{
+ if (d < DIR_End)
+ directionOut = d;
+ return (directionOut == d);
+}
+
+bool PokeGen::PokeMod::MapWarp::SetWarpType(const unsigned w)
+{
+ if (w < End)
+ warpType = w;
+ return (warpType == w);
+}
+
+void PokeGen::PokeMod::MapWarp::SetIsBiking(const bool i)
+{
+ isBiking = i;
+}
+
+void PokeGen::PokeMod::MapWarp::SetIsFlash(const bool i)
+{
+ isFlash = i;
+}
+
+void PokeGen::PokeMod::MapWarp::SetIsFoggy(const bool i)
+{
+ isFoggy = i;
+}
+
+bool PokeGen::PokeMod::MapWarp::SetToMap(const unsigned t)
+{
+ if (pokemod->GetMapByID(t) != UINT_MAX)
+ {
+ toMap = t;
+ toWarp = UINT_MAX;
+ }
+ return (toMap == t);
+}
+
+bool PokeGen::PokeMod::MapWarp::SetToWarp(const unsigned t)
+{
+ if (const Map* m = pokemod->GetMap(toMap))
+ {
+ if (m->GetWarpByID(t) != UINT_MAX)
+ toWarp = t;
+ }
+ return (toWarp == t);
+}
+
+void PokeGen::PokeMod::MapWarp::SetWorkingFlag(const unsigned f, const unsigned s)
+{
+ workingFlag.Set(f, s);
+}
+
+void PokeGen::PokeMod::MapWarp::SetWorkingFlagFlag(const unsigned f)
+{
+ workingFlag.SetFlag(f);
+}
+
+bool PokeGen::PokeMod::MapWarp::SetWorkingFlagStatus(const unsigned s)
+{
+ if (s < Flag::End)
+ {
+ workingFlag.SetStatus(s);
+ return true;
+ }
+ return false;
+}
+
+bool PokeGen::PokeMod::MapWarp::SetDialog(const unsigned d)
+{
+ if (pokemod->GetDialogByID(d) != UINT_MAX)
+ dialog = d;
+ return (dialog == d);
+}
+
+QString PokeGen::PokeMod::MapWarp::GetName() const
+{
+ return name;
+}
+
+PokeGen::PokeMod::Point PokeGen::PokeMod::MapWarp::GetCoordinate() const
+{
+ return coordinate;
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetCoordinateX() const
+{
+ return coordinate.GetX();
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetCoordinateY() const
+{
+ return coordinate.GetY();
+}
+
+bool PokeGen::PokeMod::MapWarp::GetFromUp() const
+{
+ return fromUp;
+}
+
+bool PokeGen::PokeMod::MapWarp::GetFromDown() const
+{
+ return fromDown;
+}
+
+bool PokeGen::PokeMod::MapWarp::GetFromLeft() const
+{
+ return fromLeft;
+}
+
+bool PokeGen::PokeMod::MapWarp::GetFromRight() const
+{
+ return fromRight;
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetDirectionOut() const
+{
+ return directionOut;
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetWarpType() const
+{
+ return warpType;
+}
+
+bool PokeGen::PokeMod::MapWarp::GetIsBiking() const
+{
+ return isBiking;
+}
+
+bool PokeGen::PokeMod::MapWarp::GetIsFlash() const
+{
+ return isFlash;
+}
+
+bool PokeGen::PokeMod::MapWarp::GetIsFoggy() const
+{
+ return isFoggy;
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetToMap() const
+{
+ return toMap;
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetToWarp() const
+{
+ return toWarp;
+}
+
+PokeGen::PokeMod::Flag PokeGen::PokeMod::MapWarp::GetWorkingFlag() const
+{
+ return workingFlag;
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetWorkingFlagFlag() const
+{
+ return workingFlag.GetFlag();
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetWorkingFlagStatus() const
+{
+ return workingFlag.GetStatus();
+}
+
+unsigned PokeGen::PokeMod::MapWarp::GetDialog() const
+{
+ return dialog;
+}