Loads of work on capturing pokemon
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-03-26 16:23:24 +01:00
parent 1b14f31bd7
commit 09638c8d14
12 changed files with 110 additions and 13 deletions

View File

@@ -0,0 +1,26 @@
#ifndef PKMNLIB_CAPTUREATTEMPTEVENT_HPP
#define PKMNLIB_CAPTUREATTEMPTEVENT_HPP
#include <CreatureLib/Battling/EventHooks/Events/EventData.hpp>
#include "../Pokemon/Pokemon.hpp"
#include "Arbutils/Memory/Memory.hpp"
#include "PkmnEventKind.hpp"
namespace PkmnLib::Battling {
class CaptureAttemptEvent final : public CreatureLib::Battling::EventData {
ArbUt::BorrowedPtr<PkmnLib::Battling::Pokemon> _pokemon;
CaptureLibrary::CaptureResult _result;
public:
explicit CaptureAttemptEvent(PkmnLib::Battling::Pokemon* pokemon, const CaptureLibrary::CaptureResult& result)
: _pokemon(pokemon), _result(result) {}
[[nodiscard]] CreatureLib::Battling::EventDataKind GetKind() const noexcept override {
return static_cast<CreatureLib::Battling::EventDataKind>(PkmnEventDataKind::CaptureAttempt);
}
const ArbUt::BorrowedPtr<PkmnLib::Battling::Pokemon>& GetPokemon() const noexcept { return _pokemon; }
const CaptureLibrary::CaptureResult& GetResult() const noexcept { return _result; }
};
}
#endif // PKMNLIB_CAPTUREATTEMPTEVENT_HPP

View File

@@ -2,6 +2,6 @@
#define PKMNLIB_PKMNEVENTKIND_HPP
#include <CreatureLib/Battling/EventHooks/EventDataKind.hpp>
ENUM_WITH_START_VALUE(PkmnEventDataKind, u8, 128, WeatherChange)
ENUM_WITH_START_VALUE(PkmnEventDataKind, u8, 128, WeatherChange, CaptureAttempt)
#endif // PKMNLIB_PKMNEVENTKIND_HPP