summaryrefslogtreecommitdiffstats
path: root/pokescripting/EggGroupWrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokescripting/EggGroupWrapper.cpp')
-rw-r--r--pokescripting/EggGroupWrapper.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/pokescripting/EggGroupWrapper.cpp b/pokescripting/EggGroupWrapper.cpp
index 217d84a8..2f3f9051 100644
--- a/pokescripting/EggGroupWrapper.cpp
+++ b/pokescripting/EggGroupWrapper.cpp
@@ -18,7 +18,17 @@
// Header include
#include "EggGroupWrapper.h"
-Pokescripting::EggGroupWrapper::EggGroupWrapper(const Pokemod::EggGroup* eggGroup, QObject* parent) :
+// Pokescripting includes
+#include "PokemodWrapper.h"
+
+Pokescripting::EggGroupWrapper* Pokescripting::EggGroupWrapper::create(const Pokemod::EggGroup* eggGroup, PokemodWrapper* parent)
+{
+ if (!m_instances.contains(Signiture(parent, eggGroup->id())))
+ m_instances[Signiture(parent, eggGroup->id())] = new EggGroupWrapper(eggGroup, parent);
+ return qobject_cast<EggGroupWrapper*>(m_instances[Signiture(parent, eggGroup->id())]);
+}
+
+Pokescripting::EggGroupWrapper::EggGroupWrapper(const Pokemod::EggGroup* eggGroup, PokemodWrapper* parent) :
ObjectWrapper(eggGroup, parent),
m_eggGroup(eggGroup)
{