2020-01-02 17:02:40 +00:00
|
|
|
#ifndef PKMNLIB_POKEMON_HPP
|
|
|
|
#define PKMNLIB_POKEMON_HPP
|
|
|
|
|
|
|
|
#include <Battling/Models/Creature.hpp>
|
|
|
|
#include <utility>
|
2020-01-05 14:18:30 +00:00
|
|
|
#include "../../Library/Statistic.hpp"
|
2020-01-02 17:02:40 +00:00
|
|
|
#include "../Library/BattleLibrary.hpp"
|
|
|
|
#include "LearnedMove.hpp"
|
|
|
|
|
|
|
|
namespace PkmnLib::Battling {
|
|
|
|
class Pokemon : public CreatureLib::Battling::Creature {
|
|
|
|
private:
|
|
|
|
CreatureLib::Core::StatisticSet<uint8_t> _individualValues;
|
|
|
|
CreatureLib::Core::StatisticSet<uint8_t> _effortValues;
|
|
|
|
|
2020-01-02 19:26:01 +00:00
|
|
|
uint8_t _nature;
|
|
|
|
const Library::Nature* _natureCache = nullptr;
|
|
|
|
|
2020-01-05 14:18:30 +00:00
|
|
|
const BattleLibrary* GetLibrary() const { return reinterpret_cast<const BattleLibrary*>(_library); }
|
2020-01-02 19:26:01 +00:00
|
|
|
|
2020-01-02 17:02:40 +00:00
|
|
|
public:
|
|
|
|
Pokemon(const BattleLibrary* library, const Library::PokemonSpecies* species,
|
|
|
|
const Library::PokemonForme* forme, uint8_t level, uint32_t experience, uint32_t uid,
|
|
|
|
CreatureLib::Library::Gender gender, uint8_t coloring, const Library::Item* heldItem,
|
|
|
|
const std::string& nickname, int8_t talent, std::vector<CreatureLib::Battling::LearnedAttack*> moves,
|
|
|
|
CreatureLib::Core::StatisticSet<uint8_t> individualValues,
|
2020-01-02 19:26:01 +00:00
|
|
|
CreatureLib::Core::StatisticSet<uint8_t> effortValues, uint8_t nature)
|
2020-01-02 17:02:40 +00:00
|
|
|
: CreatureLib::Battling::Creature(library, species, forme, level, experience, uid, gender, coloring,
|
|
|
|
heldItem, nickname, talent, std::move(moves)),
|
2020-01-02 19:26:01 +00:00
|
|
|
_individualValues(individualValues), _effortValues(effortValues), _nature(nature) {}
|
|
|
|
|
2020-01-26 14:18:04 +00:00
|
|
|
const Library::PokemonForme* GetForme() const {
|
|
|
|
return dynamic_cast<const Library::PokemonForme*>(GetVariant());
|
2020-01-05 14:18:30 +00:00
|
|
|
}
|
2020-01-26 14:18:04 +00:00
|
|
|
|
|
|
|
const Library::Nature& GetNature() const;
|
|
|
|
uint8_t GetIndividualValue(CreatureLib::Core::Statistic stat) const { return _individualValues.GetStat(stat); }
|
2020-01-12 17:20:59 +00:00
|
|
|
uint8_t GetEffortValue(CreatureLib::Core::Statistic stat) const { return _effortValues.GetStat(stat); }
|
2020-01-02 17:02:40 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // PKMNLIB_POKEMON_HPP
|