Mark TryGetVariant as const.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
2ea5f9f9bd
commit
667821df28
|
@ -13,7 +13,7 @@ bool CreatureSpecies::HasVariant(const std::string& name) const {
|
||||||
return _variants.find(key) != _variants.end();
|
return _variants.find(key) != _variants.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreatureSpecies::TryGetVariant(const std::string& name, const SpeciesVariant*& out) {
|
bool CreatureSpecies::TryGetVariant(const std::string& name, const SpeciesVariant*& out) const {
|
||||||
auto key = name;
|
auto key = name;
|
||||||
std::transform(key.begin(), key.end(), key.end(), ::tolower);
|
std::transform(key.begin(), key.end(), key.end(), ::tolower);
|
||||||
auto find = _variants.find(key);
|
auto find = _variants.find(key);
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace CreatureLib::Library {
|
||||||
inline uint8_t GetCaptureRate() const { return _captureRate; }
|
inline uint8_t GetCaptureRate() const { return _captureRate; }
|
||||||
|
|
||||||
[[nodiscard]] bool HasVariant(const std::string& key) const;
|
[[nodiscard]] bool HasVariant(const std::string& key) const;
|
||||||
[[nodiscard]] bool TryGetVariant(const std::string& name, const SpeciesVariant*& out);
|
[[nodiscard]] bool TryGetVariant(const std::string& name, const SpeciesVariant*& out) const;
|
||||||
[[nodiscard]] const SpeciesVariant* GetVariant(const std::string& key) const;
|
[[nodiscard]] const SpeciesVariant* GetVariant(const std::string& key) const;
|
||||||
[[nodiscard]] Gender GetRandomGender(Core::Random& rand) const;
|
[[nodiscard]] Gender GetRandomGender(Core::Random& rand) const;
|
||||||
[[nodiscard]] const std::string& GetName() const;
|
[[nodiscard]] const std::string& GetName() const;
|
||||||
|
|
Loading…
Reference in New Issue