Fixes GetEffectiveness in type library using integer instead of float.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
5cd5059e42
commit
51415895a4
|
@ -1,14 +1,11 @@
|
|||
#include "TypeLibrary.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <numeric>
|
||||
|
||||
using namespace CreatureLib::Library;
|
||||
|
||||
float TypeLibrary::GetEffectiveness(uint8_t attacking, const List<uint8_t>& defensive) const {
|
||||
auto eff = 1;
|
||||
for (auto def : defensive) {
|
||||
eff *= GetSingleEffectiveness(attacking, def);
|
||||
}
|
||||
return eff;
|
||||
return std::accumulate(defensive.begin(), defensive.end(), (float)1, std::multiplies<float>());
|
||||
}
|
||||
|
||||
float TypeLibrary::GetSingleEffectiveness(uint8_t attacking, uint8_t defensive) const {
|
||||
|
|
Loading…
Reference in New Issue