Used ClangFormat style guide I'm happy with.
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:
@@ -11,4 +11,4 @@ namespace CreatureLib::Library {
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_GROWTHRATE_HPP
|
||||
#endif // CREATURELIB_GROWTHRATE_HPP
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#include "GrowthRateLibrary.hpp"
|
||||
|
||||
uint8_t CreatureLib::Library::GrowthRateLibrary::CalculateLevel(const std::string &growthRate, uint32_t experience) const {
|
||||
uint8_t CreatureLib::Library::GrowthRateLibrary::CalculateLevel(const std::string& growthRate,
|
||||
uint32_t experience) const {
|
||||
return _growthRates.at(growthRate)->CalculateLevel(experience);
|
||||
}
|
||||
|
||||
uint32_t CreatureLib::Library::GrowthRateLibrary::CalculateExperience(const std::string &growthRate, uint8_t level) const {
|
||||
uint32_t CreatureLib::Library::GrowthRateLibrary::CalculateExperience(const std::string& growthRate,
|
||||
uint8_t level) const {
|
||||
return _growthRates.at(growthRate)->CalculateExperience(level);
|
||||
}
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
#include <unordered_map>
|
||||
#include "GrowthRate.hpp"
|
||||
|
||||
namespace CreatureLib::Library{
|
||||
namespace CreatureLib::Library {
|
||||
class GrowthRateLibrary {
|
||||
private:
|
||||
std::unordered_map<std::string, GrowthRate*> _growthRates;
|
||||
|
||||
public:
|
||||
[[nodiscard]] uint8_t CalculateLevel(const std::string& growthRate, uint32_t experience) const;
|
||||
[[nodiscard]] uint32_t CalculateExperience(const std::string& growthRate, uint8_t level) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_GROWTHRATELIBRARY_HPP
|
||||
#endif // CREATURELIB_GROWTHRATELIBRARY_HPP
|
||||
|
||||
Reference in New Issue
Block a user