From 31601349dff4b78a03bda0912d8d79b43eae42b0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 26 Aug 2008 19:03:35 +0000 Subject: [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 --- pokescripting/MapWrapper.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pokescripting/MapWrapper.cpp') 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(); +} + QString Pokescripting::MapWrapper::name() const { return m_map->name(); -- cgit