2020-08-14 13:18:00 +00:00
|
|
|
#ifndef CREATURELIB_ATTACKUSEHISTORY_HPP
|
|
|
|
#define CREATURELIB_ATTACKUSEHISTORY_HPP
|
|
|
|
#include "../../Models/ExecutingAttack.hpp"
|
|
|
|
#include "HistoryElement.hpp"
|
|
|
|
|
|
|
|
namespace CreatureLib::Battling {
|
2020-10-15 16:21:50 +00:00
|
|
|
class AttackUseHistory final : public HistoryElement {
|
2020-08-14 13:18:00 +00:00
|
|
|
std::unique_ptr<const ExecutingAttack> _attack;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void Clear() override {
|
2021-04-11 13:20:50 +00:00
|
|
|
if (_attack != nullptr) {
|
|
|
|
_attack.reset();
|
|
|
|
}
|
2020-08-14 13:18:00 +00:00
|
|
|
HistoryElement::Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
AttackUseHistory(const ExecutingAttack* attack) : _attack(attack) {}
|
|
|
|
|
|
|
|
HistoryElementKind GetKind() const noexcept override { return HistoryElementKind::AttackUse; }
|
2020-08-14 15:24:12 +00:00
|
|
|
ArbUt::BorrowedPtr<const ExecutingAttack> GetAttack() const noexcept { return _attack; }
|
2020-08-14 13:18:00 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CREATURELIB_ATTACKUSEHISTORY_HPP
|