PkmnLib/src/Battling/Pokemon/LearnedMove.hpp

26 lines
1013 B
C++
Raw Normal View History

#ifndef PKMNLIB_LEARNEDMOVE_HPP
#define PKMNLIB_LEARNEDMOVE_HPP
#include <CreatureLib/Battling/Models/LearnedAttack.hpp>
#include "../../Library/Moves/MoveData.hpp"
namespace PkmnLib::Battling {
class LearnedMove final : public CreatureLib::Battling::LearnedAttack {
public:
2020-05-27 15:26:25 +00:00
LearnedMove(const ArbUt::BorrowedPtr<const Library::MoveData>& move,
CreatureLib::Battling::AttackLearnMethod learnMethod)
: CreatureLib::Battling::LearnedAttack(move.As<const CreatureLib::Library::AttackData>(), learnMethod) {}
2020-05-27 15:26:25 +00:00
const ArbUt::BorrowedPtr<const Library::MoveData> GetMoveData() const {
return GetAttack().ForceAs<const Library::MoveData>();
2020-05-27 15:26:25 +00:00
}
LearnedAttack* Clone() const override {
auto move = new LearnedMove(GetAttack().ForceAs<const Library::MoveData>(), GetLearnMethod());
move->DecreaseUses(GetMaxUses() - GetRemainingUses());
return move;
}
};
}
#endif // PKMNLIB_LEARNEDMOVE_HPP