summaryrefslogtreecommitdiffstats
path: root/pokescripting/MoveWrapper.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-08-18 18:51:31 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-08-18 18:51:31 +0000
commitc1793a87ebea8c8e1bb2d5d1a409d105bfae3871 (patch)
treeb7ff53cf9747ad61a80b169e1adad96950f4b16c /pokescripting/MoveWrapper.cpp
parentfa4764c9e4d86fdfa976bb9fa9f6976e82c496d5 (diff)
downloadsigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.tar.gz
sigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.tar.xz
sigen-c1793a87ebea8c8e1bb2d5d1a409d105bfae3871.zip
[FIX] Script to make a tarball now defaults to HEAD for the revision
[FIX] Enumeration types used to help remove some checks [FIX] Macro code moved to static members of Object (not all though) [FIX] Scripting wrappers now share information by keeping track of already-created instances of the wrapper [FIX] Scripting methods are now Q_SCRIPTABLE and not slots git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@239 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokescripting/MoveWrapper.cpp')
-rw-r--r--pokescripting/MoveWrapper.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/pokescripting/MoveWrapper.cpp b/pokescripting/MoveWrapper.cpp
index 10ca5032..1bf5d3f8 100644
--- a/pokescripting/MoveWrapper.cpp
+++ b/pokescripting/MoveWrapper.cpp
@@ -19,9 +19,16 @@
#include "MoveWrapper.h"
// Pokescripting includes
-#include "TypeWrapper.h"
+#include "PokemodWrapper.h"
-Pokescripting::MoveWrapper::MoveWrapper(const Pokemod::Move* move, QObject* parent) :
+Pokescripting::MoveWrapper* Pokescripting::MoveWrapper::create(const Pokemod::Move* move, PokemodWrapper* parent)
+{
+ if (!m_instances.contains(Signiture(parent, move->id())))
+ m_instances[Signiture(parent, move->id())] = new MoveWrapper(move, parent);
+ return qobject_cast<MoveWrapper*>(m_instances[Signiture(parent, move->id())]);
+}
+
+Pokescripting::MoveWrapper::MoveWrapper(const Pokemod::Move* move, PokemodWrapper* parent) :
ObjectWrapper(move, parent),
m_move(move)
{
@@ -48,7 +55,7 @@ int Pokescripting::MoveWrapper::power() const
Pokescripting::TypeWrapper* Pokescripting::MoveWrapper::type()
{
- return TypeWrapper::create(pokemod()->typeById(m_move->type()), this);
+ return pokemod()->type(m_move->type());
}
bool Pokescripting::MoveWrapper::special() const