Implements Attack Use event.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef CREATURELIB_EVENTDATACLASSES_HPP
|
||||
#define CREATURELIB_EVENTDATACLASSES_HPP
|
||||
|
||||
#include "Events/AttackUseEvent.hpp"
|
||||
#include "Events/ChangeSpeciesEvent.hpp"
|
||||
#include "Events/ChangeVariantEvent.hpp"
|
||||
#include "Events/DamageEvent.hpp"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
ENUM(EventDataKind, uint8_t, Damage, Heal, Faint, Switch, TurnStart, TurnEnd, ExperienceGain, Miss, DisplayText,
|
||||
ChangeSpecies, ChangeVariant)
|
||||
ChangeSpecies, ChangeVariant, AttackUse)
|
||||
}
|
||||
|
||||
#endif // CREATURELIB_EVENTDATAKIND_HPP
|
||||
|
||||
16
src/Battling/EventHooks/Events/AttackUseEvent.hpp
Normal file
16
src/Battling/EventHooks/Events/AttackUseEvent.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef CREATURELIB_ATTACKUSEEVENT_HPP
|
||||
#define CREATURELIB_ATTACKUSEEVENT_HPP
|
||||
#include "EventData.hpp"
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class AttackUseEvent : public EventData {
|
||||
ArbUt::BorrowedPtr<ExecutingAttack> _attack;
|
||||
|
||||
public:
|
||||
AttackUseEvent(const ArbUt::BorrowedPtr<ExecutingAttack>& attack) noexcept : _attack(attack) {}
|
||||
EventDataKind GetKind() const noexcept override { return EventDataKind ::AttackUse; }
|
||||
const ArbUt::BorrowedPtr<ExecutingAttack>& GetAttack() const noexcept { return _attack; }
|
||||
};
|
||||
}
|
||||
|
||||
#endif // CREATURELIB_ATTACKUSEEVENT_HPP
|
||||
Reference in New Issue
Block a user