diff options
Diffstat (limited to 'pokescripting/CoinListWrapper.cpp')
| -rw-r--r-- | pokescripting/CoinListWrapper.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pokescripting/CoinListWrapper.cpp b/pokescripting/CoinListWrapper.cpp index 86841f2f..38807810 100644 --- a/pokescripting/CoinListWrapper.cpp +++ b/pokescripting/CoinListWrapper.cpp @@ -20,8 +20,16 @@ // Pokescripting includes #include "CoinListObjectWrapper.h" +#include "PokemodWrapper.h" -Pokescripting::CoinListWrapper::CoinListWrapper(const Pokemod::CoinList* coinList, QObject* parent) : +Pokescripting::CoinListWrapper* Pokescripting::CoinListWrapper::create(const Pokemod::CoinList* coinList, PokemodWrapper* parent) +{ + if (!m_instances.contains(Signiture(parent, coinList->id()))) + m_instances[Signiture(parent, coinList->id())] = new CoinListWrapper(coinList, parent); + return qobject_cast<CoinListWrapper*>(m_instances[Signiture(parent, coinList->id())]); +} + +Pokescripting::CoinListWrapper::CoinListWrapper(const Pokemod::CoinList* coinList, PokemodWrapper* parent) : ObjectWrapper(coinList, parent), m_coinList(coinList) { |
