From 667821df28235613bf46549734a2799b5537566f Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 13 Feb 2020 17:37:37 +0100 Subject: [PATCH] Mark TryGetVariant as const. --- src/Library/CreatureData/CreatureSpecies.cpp | 2 +- src/Library/CreatureData/CreatureSpecies.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Library/CreatureData/CreatureSpecies.cpp b/src/Library/CreatureData/CreatureSpecies.cpp index 16b3fb5..04f2ef5 100644 --- a/src/Library/CreatureData/CreatureSpecies.cpp +++ b/src/Library/CreatureData/CreatureSpecies.cpp @@ -13,7 +13,7 @@ bool CreatureSpecies::HasVariant(const std::string& name) const { 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; std::transform(key.begin(), key.end(), key.end(), ::tolower); auto find = _variants.find(key); diff --git a/src/Library/CreatureData/CreatureSpecies.hpp b/src/Library/CreatureData/CreatureSpecies.hpp index 2c62beb..23455ea 100644 --- a/src/Library/CreatureData/CreatureSpecies.hpp +++ b/src/Library/CreatureData/CreatureSpecies.hpp @@ -37,7 +37,7 @@ namespace CreatureLib::Library { inline uint8_t GetCaptureRate() const { return _captureRate; } [[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]] Gender GetRandomGender(Core::Random& rand) const; [[nodiscard]] const std::string& GetName() const;