#ifndef PKMNLIB_POKEMON_HPP #define PKMNLIB_POKEMON_HPP #include #include #include "../../Library/Statistic.hpp" #include "../Library/BattleLibrary.hpp" #include "LearnedMove.hpp" namespace PkmnLib::Battling { class Pokemon : public CreatureLib::Battling::Creature { private: CreatureLib::Library::StatisticSet _individualValues; CreatureLib::Library::StatisticSet _effortValues; ArbUt::BorrowedPtr _nature; ArbUt::BorrowedPtr GetLibrary() const { return _library.ForceAs(); } public: Pokemon(ArbUt::BorrowedPtr library, const ArbUt::BorrowedPtr& species, const ArbUt::BorrowedPtr& forme, uint8_t level, uint32_t experience, uint32_t uid, CreatureLib::Library::Gender gender, uint8_t coloring, ArbUt::BorrowedPtr heldItem, const std::string_view& nickname, const CreatureLib::Library::TalentIndex& talent, const std::vector& moves, CreatureLib::Library::StatisticSet individualValues, CreatureLib::Library::StatisticSet effortValues, ArbUt::BorrowedPtr nature, bool allowedExperienceGain = true) : CreatureLib::Battling::Creature(library.ForceAs(), species.ForceAs(), forme.As(), level, experience, uid, gender, coloring, heldItem.As(), nickname, talent, moves, allowedExperienceGain), _individualValues(individualValues), _effortValues(effortValues), _nature(nature) {} const ArbUt::BorrowedPtr GetForme() const { return _variant.As(); } inline bool IsShiny() const noexcept { return _coloring == 1; } const ArbUt::List& GetMoves() const { return reinterpret_cast&>(_attacks); } inline const ArbUt::BorrowedPtr& GetNature() const noexcept { return _nature; } inline uint8_t GetIndividualValue(CreatureLib::Library::Statistic stat) const { return _individualValues.GetStat(stat); } inline uint8_t GetEffortValue(CreatureLib::Library::Statistic stat) const { return _effortValues.GetStat(stat); } inline ArbUt::BorrowedPtr GetPokemonSpecies() const noexcept { return _species.As(); } void Evolve(ArbUt::BorrowedPtr mon, ArbUt::BorrowedPtr forme); }; } #endif // PKMNLIB_POKEMON_HPP