#ifndef CREATURELIB_SPECIESVARIANT_HPP #define CREATURELIB_SPECIESVARIANT_HPP #include #include #include #include #include "../StatisticSet.hpp" #include "LearnableAttacks.hpp" #include "TalentIndex.hpp" namespace CreatureLib::Library { /*! \brief A single species can have more than one variant. This class holds the data for those variants. */ class SpeciesVariant { protected: ArbUt::CaseInsensitiveConstString _name; float _height; float _weight; uint32_t _baseExperience; private: ArbUt::List _types; Library::StatisticSet _baseStatistics; ArbUt::List _talents; ArbUt::List _secretTalents; std::unique_ptr _attacks; public: SpeciesVariant(ArbUt::CaseInsensitiveConstString name, float height, float weight, uint32_t baseExperience, ArbUt::List types, Library::StatisticSet baseStats, ArbUt::List talents, ArbUt::List secretTalents, const LearnableAttacks* attacks); virtual ~SpeciesVariant() = default; inline const ArbUt::CaseInsensitiveConstString& GetName() const { return _name; } inline float GetHeight() const { return _height; } inline float GetWeight() const { return _weight; } inline uint32_t GetBaseExperience() const { return _baseExperience; } [[nodiscard]] size_t GetTypeCount() const; [[nodiscard]] uint8_t GetType(size_t index) const; [[nodiscard]] const ArbUt::List& GetTypes() const; [[nodiscard]] uint16_t GetStatistic(Library::Statistic stat) const; [[nodiscard]] const size_t GetTalentCount() const { return _talents.Count(); } [[nodiscard]] const size_t GetSecretTalentCount() const { return _secretTalents.Count(); } [[nodiscard]] const ArbUt::CaseInsensitiveConstString& GetTalent(const TalentIndex& index) const { if (index.IsSecret()) return _secretTalents.At(index.GetIndex()); return _talents.At(index.GetIndex()); } [[nodiscard]] const TalentIndex GetTalentIndex(const ArbUt::CaseInsensitiveConstString& talent) const; [[nodiscard]] const std::unique_ptr& GetLearnableAttacks() const; [[nodiscard]] TalentIndex GetRandomTalent(ArbUt::Random* rand) const; [[nodiscard]] inline const ArbUt::List& GetTalents() const { return _talents; } [[nodiscard]] inline const ArbUt::List& GetSecretTalents() const { return _secretTalents; } }; } #endif // CREATURELIB_SPECIESVARIANT_HPP