feat: support decimal on weight
This commit is contained in:
@@ -86,7 +86,7 @@ public class RTeam {
|
||||
.max(Integer::compareTo)
|
||||
.map(i -> Categorie.values()[i]).orElse(Categorie.SENIOR1));
|
||||
|
||||
List<Integer> s = Stream.concat(
|
||||
List<Float> s = Stream.concat(
|
||||
pair.getKey().stream().map(RegisterModel::getWeight),
|
||||
pair.getValue().stream().map(CompetitionGuestModel::getWeight))
|
||||
.filter(Objects::nonNull).toList();
|
||||
@@ -95,7 +95,7 @@ public class RTeam {
|
||||
} else if (s.size() == 1) {
|
||||
team.setWeight(s.get(0));
|
||||
} else {
|
||||
team.setWeight((int) s.stream().mapToInt(Integer::intValue)
|
||||
team.setWeight((float) s.stream().mapToDouble(Float::doubleValue)
|
||||
.average()
|
||||
.orElse(0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user