Loads of work on capturing pokemon
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
26
src/Battling/EventHooks/CaptureAttemptEvent.hpp
Normal file
26
src/Battling/EventHooks/CaptureAttemptEvent.hpp
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user