diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2008-08-18 18:51:31 +0000 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2008-08-18 18:51:31 +0000 |
commit | c1793a87ebea8c8e1bb2d5d1a409d105bfae3871 (patch) | |
tree | b7ff53cf9747ad61a80b169e1adad96950f4b16c /pokescripting/ItemWrapper.h | |
parent | fa4764c9e4d86fdfa976bb9fa9f6976e82c496d5 (diff) | |
download | sigen-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/ItemWrapper.h')
-rw-r--r-- | pokescripting/ItemWrapper.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/pokescripting/ItemWrapper.h b/pokescripting/ItemWrapper.h index 65b71239..c650ff9b 100644 --- a/pokescripting/ItemWrapper.h +++ b/pokescripting/ItemWrapper.h @@ -34,21 +34,16 @@ class POKESCRIPTING_EXPORT ItemWrapper : public ObjectWrapper Q_OBJECT public: - static ItemWrapper* create(const Pokemod::Item* item, QObject* parent) - { - if (!m_instances.contains(item->id())) - m_instances[item->id()] = new ItemWrapper(item, parent); - return qobject_cast<ItemWrapper*>(m_instances[item->id()]); - } - public slots: - QString name() const; - bool sellable() const; - ItemTypeWrapper* type(); - int price() const; - QString description() const; - Pokemod::Script script() const; + static ItemWrapper* create(const Pokemod::Item* item, PokemodWrapper* parent); + + Q_SCRIPTABLE QString name() const; + Q_SCRIPTABLE bool sellable() const; + Q_SCRIPTABLE ItemTypeWrapper* type(); + Q_SCRIPTABLE int price() const; + Q_SCRIPTABLE QString description() const; + Q_SCRIPTABLE Pokemod::Script script() const; private: - ItemWrapper(const Pokemod::Item* item, QObject* parent); + ItemWrapper(const Pokemod::Item* item, PokemodWrapper* parent); ItemWrapper& operator=(const ItemWrapper& rhs); const Pokemod::Item* m_item; |