refactor: removed outdated Player::assignDamage by multi amount dialog, fixed getMultiAmount to work with min values, added additional checks

This commit is contained in:
Oleg Agafonov 2024-10-24 15:31:04 +04:00
parent 86fc0028c1
commit 2d9ac4e732
12 changed files with 50 additions and 127 deletions

View file

@ -140,7 +140,7 @@ public enum MultiAmountType {
return res;
}
public static boolean isGoodValues(List<Integer> values, List<MultiAmountMessage> constraints, int min, int max) {
public static boolean isGoodValues(List<Integer> values, List<MultiAmountMessage> constraints, int totalMin, int totalMax) {
if (values.size() != constraints.size()) {
return false;
}
@ -156,7 +156,7 @@ public enum MultiAmountType {
currentSum += value;
}
return currentSum >= min && currentSum <= max;
return currentSum >= totalMin && currentSum <= totalMax;
}
public static List<Integer> parseAnswer(String answerToParse, List<MultiAmountMessage> constraints, int min,