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/MapWarpWrapper.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pokescripting/MapWarpWrapper.cpp') diff --git a/pokescripting/MapWarpWrapper.cpp b/pokescripting/MapWarpWrapper.cpp index 476c934d..370ad6f5 100644 --- a/pokescripting/MapWarpWrapper.cpp +++ b/pokescripting/MapWarpWrapper.cpp @@ -35,6 +35,19 @@ Pokescripting::MapWarpWrapper::MapWarpWrapper(const Pokemod::MapWarp* warp, MapW { } +Pokemod::MapWarp::Type Pokescripting::MapWarpWrapper::type(const QString& name) const +{ + if (name == "Door") + return Pokemod::MapWarp::Door; + else if (name == "Warp") + return Pokemod::MapWarp::Warp; + else if (name == "Hole") + return Pokemod::MapWarp::Hole; + else if (name == "Boundary") + return Pokemod::MapWarp::Boundary; + return QVariant(-1).value(); +} + QString Pokescripting::MapWarpWrapper::name() const { return m_warp->name(); -- cgit