Implements Attack Use event.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-08-14 14:00:41 +02:00
parent 64b08d4ff0
commit 5536a6b83d
4 changed files with 30 additions and 9 deletions

View File

@@ -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"

View File

@@ -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

View 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