24 lines
968 B
C++
24 lines
968 B
C++
#ifndef CREATURELIB_DAMAGEEVENT_HPP
|
|
#define CREATURELIB_DAMAGEEVENT_HPP
|
|
#include "EventData.hpp"
|
|
|
|
namespace CreatureLib::Battling {
|
|
class DamageEvent final : public EventData {
|
|
ArbUt::BorrowedPtr<Creature> _creature;
|
|
DamageSource _damageSource;
|
|
u32 _originalHealth;
|
|
u32 _newHealth;
|
|
|
|
public:
|
|
DamageEvent(Creature* c, DamageSource s, u32 oHealth, u32 newHealth) noexcept
|
|
: _creature(c), _damageSource(s), _originalHealth(oHealth), _newHealth(newHealth) {}
|
|
EventDataKind GetKind() const noexcept override { return EventDataKind ::Damage; }
|
|
const ArbUt::BorrowedPtr<Creature>& GetCreature() const noexcept { return _creature; }
|
|
DamageSource GetDamageSource() const noexcept { return _damageSource; }
|
|
u32 GetOriginalHealth() const noexcept { return _originalHealth; }
|
|
u32 GetNewHealth() const noexcept { return _newHealth; }
|
|
};
|
|
}
|
|
|
|
#endif // CREATURELIB_DAMAGEEVENT_HPP
|