Adds status handling functions
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-07-09 15:33:30 +02:00
parent 9303ec53e0
commit 08120d5433
6 changed files with 57 additions and 2 deletions

View 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