Trigger event when stat boost changes.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-01-16 21:16:47 +01:00
parent 987f60ee85
commit abccc23851
6 changed files with 40 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
#ifndef CHANGESTATEVENT_HPP
#define CHANGESTATEVENT_HPP
#include "EventData.hpp"
namespace CreatureLib::Battling {
class ChangeStatBoostEvent final : public EventData {
const ArbUt::BorrowedPtr<Creature> _creature;
const CreatureLib::Library::Statistic _statistic;
const int8_t _oldValue;
const int8_t _newValue;
public:
ChangeStatBoostEvent(const ArbUt::BorrowedPtr<Creature>& creature, CreatureLib::Library::Statistic statistic,
int8_t oldValue, int8_t newValue) noexcept
: _creature(creature), _statistic(statistic), _oldValue(oldValue), _newValue(newValue) {}
EventDataKind GetKind() const noexcept override { return EventDataKind ::ChangeStatBoost; }
const ArbUt::BorrowedPtr<Creature>& GetCreature() const noexcept { return _creature; }
CreatureLib::Library::Statistic GetStatistic() const noexcept { return _statistic; }
int8_t GetOldValue() const noexcept { return _oldValue; }
int8_t GetNewValue() const noexcept { return _newValue; }
};
}
#endif // CHANGESTATEVENT_HPP