Remove GetProperty macro, as it wasn't that intuitive, and caused issues later.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-01-12 17:04:42 +01:00
parent 779f0b08cf
commit b02577554f
12 changed files with 95 additions and 88 deletions

View File

@@ -4,7 +4,7 @@ using namespace CreatureLib::Library;
CreatureSpecies::CreatureSpecies(uint16_t id, std::string name, const SpeciesVariant* defaultVariant, float genderRatio,
std::string growthRate, uint8_t captureRate)
: __Id(id), __GenderRate(genderRatio), __GrowthRate(std::move(growthRate)), __CaptureRate(captureRate),
: _id(id), _genderRate(genderRatio), _growthRate(std::move(growthRate)), _captureRate(captureRate),
_variants({{"default", defaultVariant}}), _name(std::move(name)) {}
const SpeciesVariant* CreatureSpecies::GetVariant(const std::string& key) const { return _variants.at(key); }
@@ -12,7 +12,7 @@ const SpeciesVariant* CreatureSpecies::GetVariant(const std::string& key) const
Gender CreatureSpecies::GetRandomGender(CreatureLib::Core::Random& rand) const {
// TODO: Genderless creatures
auto val = rand.GetDouble();
if (val >= this->__GenderRate)
if (val >= this->_genderRate)
return Gender ::Female;
return Gender ::Male;
}