CreatureLib/src/Battling/History/HistoryElements/AttackUseHistory.hpp

27 lines
830 B
C++

#ifndef CREATURELIB_ATTACKUSEHISTORY_HPP
#define CREATURELIB_ATTACKUSEHISTORY_HPP
#include "../../Models/ExecutingAttack.hpp"
#include "HistoryElement.hpp"
namespace CreatureLib::Battling {
class AttackUseHistory final : public HistoryElement {
std::unique_ptr<const ExecutingAttack> _attack;
protected:
void Clear() override {
if (_attack != nullptr) {
_attack.reset();
}
HistoryElement::Clear();
}
public:
AttackUseHistory(const ExecutingAttack* attack) : _attack(attack) {}
HistoryElementKind GetKind() const noexcept override { return HistoryElementKind::AttackUse; }
ArbUt::BorrowedPtr<const ExecutingAttack> GetAttack() const noexcept { return _attack; }
};
}
#endif // CREATURELIB_ATTACKUSEHISTORY_HPP