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