Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-28 12:55:22 +01:00
parent 3b685ae782
commit a8730d983f
91 changed files with 946 additions and 1121 deletions

View File

@@ -11,4 +11,4 @@ namespace CreatureLib::Library {
};
}
#endif //CREATURELIB_GROWTHRATE_HPP
#endif // CREATURELIB_GROWTHRATE_HPP

View File

@@ -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);
}

View File

@@ -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