summaryrefslogtreecommitdiffstats
path: root/pokescripting/MapWrapper.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-08-26 19:03:35 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-08-26 19:03:35 +0000
commit31601349dff4b78a03bda0912d8d79b43eae42b0 (patch)
treed81b20394a8b2a13728c22cf5e75ae77e747144d /pokescripting/MapWrapper.cpp
parent940e5d4b55bbd1261bf0ccb3a915b79cf2a240c8 (diff)
downloadsigen-31601349dff4b78a03bda0912d8d79b43eae42b0.tar.gz
sigen-31601349dff4b78a03bda0912d8d79b43eae42b0.tar.xz
sigen-31601349dff4b78a03bda0912d8d79b43eae42b0.zip
[FIX] Enumerations now have access from scripts (name->value)
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@245 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokescripting/MapWrapper.cpp')
-rw-r--r--pokescripting/MapWrapper.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/pokescripting/MapWrapper.cpp b/pokescripting/MapWrapper.cpp
index 9564a995..ebd37ceb 100644
--- a/pokescripting/MapWrapper.cpp
+++ b/pokescripting/MapWrapper.cpp
@@ -58,6 +58,17 @@ Pokescripting::MapWildListWrapper* Pokescripting::MapWrapper::wildList(const int
return MapWildListWrapper::create(m_map->wildListById(id), this);
}
+Pokemod::Map::Type Pokescripting::MapWrapper::type(const QString& name) const
+{
+ if (name == "Outdoor")
+ return Pokemod::Map::Outdoor;
+ else if (name == "Dungeon")
+ return Pokemod::Map::Dungeon;
+ else if (name == "Building")
+ return Pokemod::Map::Building;
+ return QVariant(-1).value<Pokemod::Map::Type>();
+}
+
QString Pokescripting::MapWrapper::name() const
{
return m_map->name();