#ifndef PKMNLIB_BATTLE_HPP #define PKMNLIB_BATTLE_HPP #include #include "../EventHooks/WeatherChangeEvent.hpp" #include "../Library/BattleLibrary.hpp" #include "../PkmnScriptCategory.hpp" namespace PkmnLib::Battling { class Battle : public CreatureLib::Battling::Battle { private: std::unique_ptr _weatherScript = nullptr; public: Battle(const BattleLibrary* library, const ArbUt::List& parties, bool canFlee = true, uint8_t numberOfSides = 2, uint8_t creaturesPerSide = 1, uint_fast32_t randomSeed = std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch()) .count()) : CreatureLib::Battling::Battle(library, parties, canFlee, numberOfSides, creaturesPerSide, randomSeed) {} void SetWeather(const ArbUt::StringView& name); void ClearWeather(); const ArbUt::StringView& GetWeatherName() noexcept { if (_weatherScript == nullptr) return ArbUt::StringView::EmptyString(); return _weatherScript->GetName(); } size_t ScriptCount() const override { return CreatureLib::Battling::Battle::ScriptCount() + 1; } void GetActiveScripts(ArbUt::List& scripts) override { CreatureLib::Battling::Battle::GetActiveScripts(scripts); scripts.Append(CreatureLib::Battling::ScriptWrapper( CreatureLib::Battling::ScriptWrapper::FromScript(&_weatherScript))); } }; } #endif // PKMNLIB_BATTLE_HPP