Mark TryGetVariant as const.
	
		
			
	
		
	
	
		
	
		
			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:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user