Add TurnStart, TurnEnd and ExperienceGain event triggers.
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:
@@ -67,6 +67,32 @@ namespace CreatureLib::Battling {
|
||||
const ArbUt::BorrowedPtr<Creature>& GetNewCreature() const noexcept { return _newCreature; }
|
||||
};
|
||||
|
||||
class TurnStartEvent : public EventData {
|
||||
public:
|
||||
TurnStartEvent() {}
|
||||
EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnStart; }
|
||||
};
|
||||
|
||||
class TurnEndEvent : public EventData {
|
||||
public:
|
||||
TurnEndEvent() {}
|
||||
EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnEnd; }
|
||||
};
|
||||
|
||||
class ExperienceGainEvent : public EventData {
|
||||
ArbUt::BorrowedPtr<Creature> _creature;
|
||||
uint32_t _previousExperience;
|
||||
uint32_t _newExperience;
|
||||
|
||||
public:
|
||||
ExperienceGainEvent(const ArbUt::BorrowedPtr<Creature>& creature, uint32_t previousExp, uint32_t newExp)
|
||||
: _creature(creature), _previousExperience(previousExp), _newExperience(newExp) {}
|
||||
EventDataKind GetKind() const noexcept override { return EventDataKind ::ExperienceGain; }
|
||||
const ArbUt::BorrowedPtr<Creature>& GetCreature() const noexcept { return _creature; }
|
||||
uint32_t GetPreviousExperience() const noexcept { return _previousExperience; }
|
||||
uint32_t GetNewExperience() const noexcept { return _newExperience; }
|
||||
};
|
||||
|
||||
class DisplayTextEvent : public EventData {
|
||||
const ArbUt::StringView _text;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <Arbutils/Enum.hpp>
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
ENUM(EventDataKind, uint8_t, Damage, Heal, Faint, Switch, DisplayText)
|
||||
ENUM(EventDataKind, uint8_t, Damage, Heal, Faint, Switch, TurnStart, TurnEnd, ExperienceGain, DisplayText)
|
||||
}
|
||||
|
||||
#endif // CREATURELIB_EVENTDATAKIND_HPP
|
||||
|
||||
Reference in New Issue
Block a user