summaryrefslogtreecommitdiffstats
path: root/pokescripting/ItemWrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'pokescripting/ItemWrapper.h')
-rw-r--r--pokescripting/ItemWrapper.h23
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;