diff options
Diffstat (limited to 'pokescripting/WeatherWrapper.cpp')
| -rw-r--r-- | pokescripting/WeatherWrapper.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pokescripting/WeatherWrapper.cpp b/pokescripting/WeatherWrapper.cpp index 08e0e272..ad7bc990 100644 --- a/pokescripting/WeatherWrapper.cpp +++ b/pokescripting/WeatherWrapper.cpp @@ -18,7 +18,17 @@ // Header include #include "WeatherWrapper.h" -Pokescripting::WeatherWrapper::WeatherWrapper(const Pokemod::Weather* weather, QObject* parent) : +// Pokescripting includes +#include "PokemodWrapper.h" + +Pokescripting::WeatherWrapper* Pokescripting::WeatherWrapper::create(const Pokemod::Weather* weather, PokemodWrapper* parent) +{ + if (!m_instances.contains(Signiture(parent, weather->id()))) + m_instances[Signiture(parent, weather->id())] = new WeatherWrapper(weather, parent); + return qobject_cast<WeatherWrapper*>(m_instances[Signiture(parent, weather->id())]); +} + +Pokescripting::WeatherWrapper::WeatherWrapper(const Pokemod::Weather* weather, PokemodWrapper* parent) : ObjectWrapper(weather, parent), m_weather(weather) { |
