PkmnLib/src/Battling/Pokemon/Pokemon.hpp

51 lines
2.3 KiB
C++
Raw Normal View History

#ifndef PKMNLIB_POKEMON_HPP
#define PKMNLIB_POKEMON_HPP
#include <CreatureLib/Battling/Models/Creature.hpp>
#include <utility>
2020-01-05 14:18:30 +00:00
#include "../../Library/Statistic.hpp"
#include "../Library/BattleLibrary.hpp"
#include "LearnedMove.hpp"
namespace PkmnLib::Battling {
class Pokemon : public CreatureLib::Battling::Creature {
private:
CreatureLib::Library::StatisticSet<uint8_t> _individualValues;
CreatureLib::Library::StatisticSet<uint8_t> _effortValues;
2020-04-17 16:20:48 +00:00
Arbutils::CaseInsensitiveConstString _nature;
2020-01-02 19:26:01 +00:00
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
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, const CreatureLib::Library::TalentIndex& talent,
List<CreatureLib::Battling::LearnedAttack*> moves,
CreatureLib::Library::StatisticSet<uint8_t> individualValues,
2020-04-17 16:20:48 +00:00
CreatureLib::Library::StatisticSet<uint8_t> effortValues, const Arbutils::CaseInsensitiveConstString& nature)
: 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) {}
const Library::PokemonForme* GetForme() const {
return dynamic_cast<const Library::PokemonForme*>(GetVariant());
2020-01-05 14:18:30 +00:00
}
const bool IsShiny() const { return _coloring == 1; }
2020-02-02 14:34:38 +00:00
const std::vector<LearnedMove*>& GetMoves() const {
return reinterpret_cast<const std::vector<LearnedMove*>&>(_attacks);
}
const Library::Nature& GetNature() const;
uint8_t GetIndividualValue(CreatureLib::Library::Statistic stat) const {
return _individualValues.GetStat(stat);
}
uint8_t GetEffortValue(CreatureLib::Library::Statistic stat) const { return _effortValues.GetStat(stat); }
};
}
#endif // PKMNLIB_POKEMON_HPP