#ifndef PKMNLIB_POKEMONSPECIES_HPP #define PKMNLIB_POKEMONSPECIES_HPP #include #include #include "../Evolutions/EvolutionData.hpp" #include "PokemonForme.hpp" namespace PkmnLib::Library { class PokemonSpecies : public CreatureLib::Library::CreatureSpecies { private: uint8_t _baseHappiness; ArbUt::UniquePtrList _evolutions; public: PokemonSpecies(uint16_t id, const ArbUt::CaseInsensitiveConstString& name, const PokemonForme* defaultForme, float genderRatio, const ArbUt::CaseInsensitiveConstString& growthRate, uint8_t captureRate, uint8_t baseHappiness) noexcept : CreatureSpecies(id, name, defaultForme, genderRatio, growthRate, captureRate), _baseHappiness(baseHappiness) {} ~PokemonSpecies() override = default; inline uint8_t GetBaseHappiness() const { return _baseHappiness; } inline ArbUt::BorrowedPtr GetDefaultForme() const { return CreatureSpecies::GetVariant("default"_cnc.GetHash()).As(); } inline bool HasForme(const ArbUt::CaseInsensitiveConstString& key) const { return HasVariant(key); } inline bool TryGetForme(const ArbUt::CaseInsensitiveConstString& key, ArbUt::BorrowedPtr& forme) const { auto v = forme.As(); auto res = TryGetVariant(key, v); forme = v.As(); return res; } inline ArbUt::BorrowedPtr GetForme(const ArbUt::CaseInsensitiveConstString& key) const { return CreatureSpecies::GetVariant(key).As(); } inline void AddEvolution(const EvolutionData* data) noexcept { _evolutions.Append(data); } const ArbUt::UniquePtrList& GetEvolutions() const noexcept { return _evolutions; } }; } #endif // PKMNLIB_POKEMONSPECIES_HPP