Files
CreatureLib/src/Battling/EventHooks/Events/StatusChangeEvent.hpp
Deukhoofd 08120d5433
All checks were successful
continuous-integration/drone/push Build is passing
Adds status handling functions
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2021-07-09 15:33:30 +02:00

23 lines
908 B
C++

#ifndef CREATURELIB_STATUSCHANGEEVENT_HPP
#define CREATURELIB_STATUSCHANGEEVENT_HPP
namespace CreatureLib::Battling {
class StatusChangeEvent final : public CreatureLib::Battling::EventData {
ArbUt::BorrowedPtr<Creature> _creature;
ArbUt::StringView _statusName;
public:
explicit StatusChangeEvent(const ArbUt::BorrowedPtr<Creature>& creature, const ArbUt::StringView& name)
: _creature(creature), _statusName(name) {}
[[nodiscard]] CreatureLib::Battling::EventDataKind GetKind() const noexcept override {
return static_cast<CreatureLib::Battling::EventDataKind>(EventDataKind::StatusChange);
}
const ArbUt::BorrowedPtr<Creature>& GetCreature() const noexcept { return _creature; }
const ArbUt::StringView& GetStatusName() const noexcept { return _statusName; }
};
}
#endif // CREATURELIB_STATUSCHANGEEVENT_HPP