Updates to newer CreatureLib.

This commit is contained in:
2021-03-07 11:12:18 +01:00
parent f8427fa594
commit 18cebe842a
9 changed files with 18 additions and 15 deletions

View File

@@ -3,7 +3,7 @@ void PkmnLib::Battling::Battle::SetWeather(const ArbUt::StringView& name) {
if (_weatherScript != nullptr) {
_weatherScript->OnRemove();
}
_weatherScript = std::unique_ptr<CreatureLib::Battling::Script>(
_weatherScript = std::unique_ptr<CreatureLib::Battling::BattleScript>(
_library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name));
_eventHook.Trigger<WeatherChangeEvent>(name);
}

View File

@@ -4,12 +4,13 @@
#include <CreatureLib/Battling/Models/Battle.hpp>
#include "../EventHooks/WeatherChangeEvent.hpp"
#include "../Library/BattleLibrary.hpp"
#include "../PkmnScript.hpp"
#include "../PkmnScriptCategory.hpp"
namespace PkmnLib::Battling {
class Battle : public CreatureLib::Battling::Battle {
private:
std::unique_ptr<CreatureLib::Battling::Script> _weatherScript = nullptr;
std::unique_ptr<CreatureLib::Battling::BattleScript> _weatherScript = nullptr;
public:
Battle(const BattleLibrary* library, const ArbUt::List<CreatureLib::Battling::BattleParty*>& parties,