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

@ -2875,11 +2875,11 @@ public class TestPlayer implements Player {
@Override
public List<Integer> getMultiAmountWithIndividualConstraints(Outcome outcome, List<MultiAmountMessage> messages,
int min, int max, MultiAmountType type, Game game) {
int totalMin, int totalMax, MultiAmountType type, Game game) {
assertAliasSupportInChoices(false);
int needCount = messages.size();
List<Integer> defaultList = MultiAmountType.prepareDefaltValues(messages, min, max);
List<Integer> defaultList = MultiAmountType.prepareDefaltValues(messages, totalMin, totalMax);
if (needCount == 0) {
return defaultList;
}
@ -2905,7 +2905,7 @@ public class TestPlayer implements Player {
}
// extra check
if (!MultiAmountType.isGoodValues(answer, messages, min, max)) {
if (!MultiAmountType.isGoodValues(answer, messages, totalMin, totalMax)) {
Assert.fail("Wrong choices in multi amount: " + answer
.stream()
.map(String::valueOf)
@ -2916,7 +2916,7 @@ public class TestPlayer implements Player {
}
this.chooseStrictModeFailed("choice", game, "Multi amount: " + type.getHeader());
return computerPlayer.getMultiAmountWithIndividualConstraints(outcome, messages, min, max, type, game);
return computerPlayer.getMultiAmountWithIndividualConstraints(outcome, messages, totalMin, totalMax, type, game);
}
@Override
@ -4384,14 +4384,6 @@ public class TestPlayer implements Player {
return computerPlayer.chooseBlockerOrder(blockers, combatGroup, blockerOrder, game);
}
@Override
public void assignDamage(int damage, List<UUID> targets,
String singleTargetName, UUID attackerId, Ability source,
Game game
) {
computerPlayer.assignDamage(damage, targets, singleTargetName, attackerId, source, game);
}
@Override
public void sideboard(Match match, Deck deck
) {