#ifndef CREATURELIB_SPECIESVARIANT_HPP #define CREATURELIB_SPECIESVARIANT_HPP #include #include #include #include #include "../StatisticSet.hpp" #include "CreatureMoves.hpp" #include "LearnableAttacks.hpp" #include "TalentIndex.hpp" using ConstString = Arbutils::CaseInsensitiveConstString; using namespace Arbutils::Collections; namespace CreatureLib::Library { /*! \brief A single species can have more than one variant. This class holds the data for those variants. */ class SpeciesVariant { protected: ConstString _name; float _height; float _weight; uint32_t _baseExperience; private: List _types; Library::StatisticSet _baseStatistics; List _talents; List _secretTalents; std::unique_ptr _attacks; public: SpeciesVariant(ConstString name, float height, float weight, uint32_t baseExperience, List types, Library::StatisticSet baseStats, List talents, List secretTalents, const LearnableAttacks* attacks); virtual ~SpeciesVariant() = default; inline const ConstString& 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 List& GetTypes() const; [[nodiscard]] uint32_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 ConstString& GetTalent(const TalentIndex& index) const { if (index.IsSecret()) return _secretTalents.At(index.GetIndex()); return _talents.At(index.GetIndex()); } [[nodiscard]] const TalentIndex GetTalentIndex(const ConstString& talent) const; [[nodiscard]] const std::unique_ptr& GetLearnableAttacks() const; [[nodiscard]] TalentIndex GetRandomTalent(Arbutils::Random* rand) const; [[nodiscard]] inline const List& GetTalents() const { return _talents; } [[nodiscard]] inline const List& GetSecretTalents() const { return _secretTalents; } }; } #endif // CREATURELIB_SPECIESVARIANT_HPP