2019-10-23 16:57:50 +00:00
|
|
|
#ifndef CREATURELIB_LEARNEDATTACK_HPP
|
|
|
|
#define CREATURELIB_LEARNEDATTACK_HPP
|
|
|
|
|
2019-10-24 11:37:55 +00:00
|
|
|
#include "../../Library/Attacks/AttackData.hpp"
|
2019-10-24 09:04:19 +00:00
|
|
|
#include "AttackLearnMethod.hpp"
|
2019-10-23 16:57:50 +00:00
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
namespace CreatureLib::Battling {
|
2019-10-23 16:57:50 +00:00
|
|
|
class LearnedAttack {
|
2019-10-24 11:37:55 +00:00
|
|
|
const Library::AttackData* _attack;
|
2019-10-23 17:21:21 +00:00
|
|
|
uint8_t _maxUses;
|
|
|
|
uint8_t _remainingUses;
|
2019-10-24 09:04:19 +00:00
|
|
|
AttackLearnMethod _learnMethod;
|
2019-11-28 11:55:22 +00:00
|
|
|
|
2019-10-23 16:57:50 +00:00
|
|
|
public:
|
2019-10-24 11:37:55 +00:00
|
|
|
LearnedAttack(Library::AttackData* attack, uint8_t maxUses, AttackLearnMethod learnMethod);
|
2019-10-25 18:08:25 +00:00
|
|
|
LearnedAttack(const Library::AttackData* attack, AttackLearnMethod learnMethod);
|
2019-10-23 17:21:21 +00:00
|
|
|
|
2020-01-25 11:37:05 +00:00
|
|
|
virtual ~LearnedAttack() = default;
|
|
|
|
|
2019-10-24 11:37:55 +00:00
|
|
|
const Library::AttackData* GetAttack() const;
|
2019-10-23 17:21:21 +00:00
|
|
|
uint8_t GetMaxUses() const;
|
|
|
|
uint8_t GetRemainingUses() const;
|
2019-10-24 09:04:19 +00:00
|
|
|
AttackLearnMethod GetLearnMethod() const;
|
|
|
|
|
2020-01-25 11:37:05 +00:00
|
|
|
virtual bool TryUse(uint8_t uses);
|
|
|
|
virtual void DecreaseUses(uint8_t amount);
|
|
|
|
virtual void RestoreUses(uint8_t amount);
|
|
|
|
virtual void RestoreUses();
|
2019-10-23 16:57:50 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
#endif // CREATURELIB_LEARNEDATTACK_HPP
|