From c1793a87ebea8c8e1bb2d5d1a409d105bfae3871 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 18 Aug 2008 18:51:31 +0000 Subject: [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 --- pokescripting/MoveWrapper.h | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'pokescripting/MoveWrapper.h') diff --git a/pokescripting/MoveWrapper.h b/pokescripting/MoveWrapper.h index cd5d0f43..c17ff555 100644 --- a/pokescripting/MoveWrapper.h +++ b/pokescripting/MoveWrapper.h @@ -34,25 +34,20 @@ class POKESCRIPTING_EXPORT MoveWrapper : public ObjectWrapper Q_OBJECT public: - static MoveWrapper* create(const Pokemod::Move* move, QObject* parent) - { - if (!m_instances.contains(move->id())) - m_instances[move->id()] = new MoveWrapper(move, parent); - return qobject_cast(m_instances[move->id()]); - } - public slots: - QString name() const; - Pokemod::Fraction accuracy() const; - int power() const; - TypeWrapper* type(); - bool special() const; - int powerPoints() const; - int priority() const; - QString description() const; - Pokemod::Script battleScript() const; - Pokemod::Script worldScript() const; + static MoveWrapper* create(const Pokemod::Move* move, PokemodWrapper* parent); + + Q_SCRIPTABLE QString name() const; + Q_SCRIPTABLE Pokemod::Fraction accuracy() const; + Q_SCRIPTABLE int power() const; + Q_SCRIPTABLE TypeWrapper* type(); + Q_SCRIPTABLE bool special() const; + Q_SCRIPTABLE int powerPoints() const; + Q_SCRIPTABLE int priority() const; + Q_SCRIPTABLE QString description() const; + Q_SCRIPTABLE Pokemod::Script battleScript() const; + Q_SCRIPTABLE Pokemod::Script worldScript() const; private: - MoveWrapper(const Pokemod::Move* move, QObject* parent); + MoveWrapper(const Pokemod::Move* move, PokemodWrapper* parent); MoveWrapper& operator=(const MoveWrapper& rhs); const Pokemod::Move* m_move; -- cgit