diff options
Diffstat (limited to 'pokescripting/MapWildListWrapper.cpp')
| -rw-r--r-- | pokescripting/MapWildListWrapper.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pokescripting/MapWildListWrapper.cpp b/pokescripting/MapWildListWrapper.cpp index 3689cc1e..3b725b34 100644 --- a/pokescripting/MapWildListWrapper.cpp +++ b/pokescripting/MapWildListWrapper.cpp @@ -19,9 +19,17 @@ #include "MapWildListWrapper.h" // Pokescripting includes +#include "MapWrapper.h" #include "MapWildListEncounterWrapper.h" -Pokescripting::MapWildListWrapper::MapWildListWrapper(const Pokemod::MapWildList* wildList, QObject* parent) : +Pokescripting::MapWildListWrapper* Pokescripting::MapWildListWrapper::create(const Pokemod::MapWildList* wildList, MapWrapper* parent) +{ + if (!m_instances.contains(Signiture(parent, wildList->id()))) + m_instances[Signiture(parent, wildList->id())] = new MapWildListWrapper(wildList, parent); + return qobject_cast<MapWildListWrapper*>(m_instances[Signiture(parent, wildList->id())]); +} + +Pokescripting::MapWildListWrapper::MapWildListWrapper(const Pokemod::MapWildList* wildList, MapWrapper* parent) : ObjectWrapper(wildList, parent), m_wildList(wildList) { |
