Adds status handling functions
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:
22
src/Battling/EventHooks/Events/StatusChangeEvent.hpp
Normal file
22
src/Battling/EventHooks/Events/StatusChangeEvent.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user