Battle C Interface.

This commit is contained in:
2020-04-26 20:01:11 +02:00
parent ec1685aa14
commit 718c146ebe
4 changed files with 45 additions and 26 deletions

View File

@@ -1 +1,15 @@
#include "Battle.hpp"
void PkmnLib::Battling::Battle::SetWeather(const Arbutils::CaseInsensitiveConstString& name) {
if (_weatherScript != nullptr) {
_weatherScript->OnRemove();
delete _weatherScript;
}
_weatherScript = _library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name);
_eventHook.TriggerEvent(new WeatherChangeEvent(name));
}
void PkmnLib::Battling::Battle::ClearWeather() {
_weatherScript->OnRemove();
delete _weatherScript;
_weatherScript = nullptr;
_eventHook.TriggerEvent(new WeatherChangeEvent(""_cnc));
}