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/TrainerWrapper.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pokescripting/TrainerWrapper.cpp') diff --git a/pokescripting/TrainerWrapper.cpp b/pokescripting/TrainerWrapper.cpp index 7f19bfb1..d552070b 100644 --- a/pokescripting/TrainerWrapper.cpp +++ b/pokescripting/TrainerWrapper.cpp @@ -34,6 +34,19 @@ Pokescripting::TrainerWrapper::TrainerWrapper(const Pokemod::Trainer* trainer, P { } +Pokemod::Trainer::Intelligence Pokescripting::TrainerWrapper::intelligence(const QString& name) const +{ + if (name == "Ignorant") + return Pokemod::Trainer::Ignorant; + else if (name == "Determine") + return Pokemod::Trainer::Determine; + else if (name == "Remember") + return Pokemod::Trainer::Remember; + else if (name == "Cheating") + return Pokemod::Trainer::Cheating; + return QVariant(-1).value(); +} + QString Pokescripting::TrainerWrapper::TrainerWrapper::name() const { return m_trainer->name(); -- cgit