summaryrefslogtreecommitdiffstats
path: root/pokescripting/MapEffectWrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokescripting/MapEffectWrapper.cpp')
-rw-r--r--pokescripting/MapEffectWrapper.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/pokescripting/MapEffectWrapper.cpp b/pokescripting/MapEffectWrapper.cpp
index 9274ade8..ac1d7c41 100644
--- a/pokescripting/MapEffectWrapper.cpp
+++ b/pokescripting/MapEffectWrapper.cpp
@@ -19,9 +19,17 @@
#include "MapEffectWrapper.h"
// Pokescripting includes
-#include "SkinWrapper.h"
+#include "MapWrapper.h"
+#include "PokemodWrapper.h"
-Pokescripting::MapEffectWrapper::MapEffectWrapper(const Pokemod::MapEffect* effect, QObject* parent) :
+Pokescripting::MapEffectWrapper* Pokescripting::MapEffectWrapper::create(const Pokemod::MapEffect* effect, MapWrapper* parent)
+{
+ if (!m_instances.contains(Signiture(parent, effect->id())))
+ m_instances[Signiture(parent, effect->id())] = new MapEffectWrapper(effect, parent);
+ return qobject_cast<MapEffectWrapper*>(m_instances[Signiture(parent, effect->id())]);
+}
+
+Pokescripting::MapEffectWrapper::MapEffectWrapper(const Pokemod::MapEffect* effect, MapWrapper* parent) :
ObjectWrapper(effect, parent),
m_effect(effect)
{
@@ -41,7 +49,7 @@ QPoint Pokescripting::MapEffectWrapper::coordinate() const
Pokescripting::SkinWrapper* Pokescripting::MapEffectWrapper::skin()
{
- return SkinWrapper::create(pokemod()->skinById(m_effect->skin()), this);
+ return pokemod()->skin(m_effect->skin());
}
bool Pokescripting::MapEffectWrapper::isGhost() const