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:
@@ -2,9 +2,9 @@
|
||||
|
||||
using namespace CreatureLib::Library;
|
||||
|
||||
float TypeLibrary::GetEffectiveness(uint8_t attacking, const std::vector<uint8_t> &defensive) const {
|
||||
float TypeLibrary::GetEffectiveness(uint8_t attacking, const std::vector<uint8_t>& defensive) const {
|
||||
auto eff = 1;
|
||||
for (auto def: defensive){
|
||||
for (auto def : defensive) {
|
||||
eff *= GetSingleEffectiveness(attacking, def);
|
||||
}
|
||||
return eff;
|
||||
@@ -14,14 +14,12 @@ float TypeLibrary::GetSingleEffectiveness(uint8_t attacking, uint8_t defensive)
|
||||
return _effectiveness[attacking][defensive];
|
||||
}
|
||||
|
||||
uint8_t TypeLibrary::GetTypeId(const std::string &s) const {
|
||||
return _types.at(s);
|
||||
}
|
||||
uint8_t TypeLibrary::GetTypeId(const std::string& s) const { return _types.at(s); }
|
||||
|
||||
uint8_t TypeLibrary::RegisterType(const std::string& typeName) {
|
||||
_types.insert({typeName, _types.size()});
|
||||
_effectiveness.resize(_types.size());
|
||||
for (auto & eff : _effectiveness){
|
||||
for (auto& eff : _effectiveness) {
|
||||
eff.resize(_types.size(), 1);
|
||||
}
|
||||
return _types.size() - 1;
|
||||
|
||||
Reference in New Issue
Block a user