#ifndef CREATURELIB_LEARNEDATTACK_HPP #define CREATURELIB_LEARNEDATTACK_HPP #include "../../Library/Attacks/AttackData.hpp" #include "AttackLearnMethod.hpp" namespace CreatureLib::Battling { class LearnedAttack { ArbUt::BorrowedPtr _attack; uint8_t _maxUses; uint8_t _remainingUses; AttackLearnMethod _learnMethod; public: LearnedAttack(const ArbUt::BorrowedPtr& attack, uint8_t maxUses, AttackLearnMethod learnMethod); LearnedAttack(const ArbUt::BorrowedPtr& attack, AttackLearnMethod learnMethod); virtual ~LearnedAttack() = default; const ArbUt::BorrowedPtr& GetAttack() const noexcept; uint8_t GetMaxUses() const noexcept; uint8_t GetRemainingUses() const noexcept; AttackLearnMethod GetLearnMethod() const noexcept; virtual bool TryUse(uint8_t uses) noexcept; virtual void DecreaseUses(uint8_t amount) noexcept; virtual void RestoreUses(uint8_t amount) noexcept; virtual void RestoreAllUses() noexcept; virtual LearnedAttack* Clone() { auto* attack = new LearnedAttack(_attack, _maxUses, _learnMethod); attack->_remainingUses = _remainingUses; return attack; } }; } #endif // CREATURELIB_LEARNEDATTACK_HPP