Remove creature classes from Library lib, merged with Battling lib.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -6,12 +6,12 @@ CreatureSpecies::CreatureSpecies(uint16_t id, std::string name, const SpeciesVar
|
||||
float genderRatio, std::string growthRate, uint8_t captureRate, uint8_t baseHappiness)
|
||||
:
|
||||
__Id(id),
|
||||
__Name(std::move(name)),
|
||||
__GenderRate(genderRatio),
|
||||
__GrowthRate(std::move(growthRate)),
|
||||
__CaptureRate(captureRate),
|
||||
__BaseHappiness(baseHappiness),
|
||||
_variants({{"default", defaultVariant}})
|
||||
_variants({{"default", defaultVariant}}),
|
||||
_name(std::move(name))
|
||||
{}
|
||||
|
||||
const SpeciesVariant *CreatureSpecies::GetVariant(const std::string& key) const {
|
||||
@@ -25,3 +25,7 @@ Gender CreatureSpecies::GetRandomGender(CreatureLib::Core::Random &rand) const {
|
||||
return Gender ::Male;
|
||||
}
|
||||
|
||||
const std::string &CreatureSpecies::GetName() const {
|
||||
return _name;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace CreatureLib::Library {
|
||||
*/
|
||||
class CreatureSpecies {
|
||||
GetProperty(uint16_t, Id);
|
||||
GetProperty(std::string, Name);
|
||||
GetProperty(float, GenderRate);
|
||||
GetProperty(std::string, GrowthRate);
|
||||
GetProperty(uint8_t, CaptureRate);
|
||||
GetProperty(uint8_t, BaseHappiness);
|
||||
private:
|
||||
std::unordered_map<std::string, const SpeciesVariant*> _variants;
|
||||
std::string _name;
|
||||
public:
|
||||
CreatureSpecies(uint16_t id, std::string name, const SpeciesVariant* defaultVariant,
|
||||
float genderRatio, std::string growthRate, uint8_t captureRate, uint8_t baseHappiness);
|
||||
@@ -31,6 +31,7 @@ namespace CreatureLib::Library {
|
||||
|
||||
[[nodiscard]] const SpeciesVariant* GetVariant(const std::string& key) const;
|
||||
[[nodiscard]] Gender GetRandomGender(Core::Random& rand) const;
|
||||
[[nodiscard]] const std::string& GetName() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ uint32_t CreatureLib::Library::SpeciesVariant::GetStatistic(CreatureLib::Core::S
|
||||
return _baseStatistics.GetStat(stat);
|
||||
}
|
||||
|
||||
std::string CreatureLib::Library::SpeciesVariant::GetTalent(int32_t index) const {
|
||||
const std::string& CreatureLib::Library::SpeciesVariant::GetTalent(int32_t index) const {
|
||||
if (index < 0){
|
||||
index = -index - 1;
|
||||
return _secretTalents[index];
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CreatureLib::Library {
|
||||
[[nodiscard]] size_t GetTypeCount() const;
|
||||
[[nodiscard]] std::string GetType(size_t index) const;
|
||||
[[nodiscard]] uint32_t GetStatistic(Core::Statistic stat) const;
|
||||
[[nodiscard]] std::string GetTalent(int32_t index) const;
|
||||
[[nodiscard]] const std::string& GetTalent(int32_t index) const;
|
||||
[[nodiscard]] const LearnableAttacks* GetLearnableAttacks() const;
|
||||
[[nodiscard]] int8_t GetTalentIndex(std::string talent) const;
|
||||
[[nodiscard]] int8_t GetRandomTalent(Core::Random* rand) const;
|
||||
|
||||
Reference in New Issue
Block a user