forked from External/mage
refactor: removed outdated Player::assignDamage by multi amount dialog, fixed getMultiAmount to work with min values, added additional checks
This commit is contained in:
parent
86fc0028c1
commit
2d9ac4e732
12 changed files with 50 additions and 127 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue