From 0c8ef41012144e42000bae9538462d0ff6561439 Mon Sep 17 00:00:00 2001 From: DeepCrimson <98864333+DeepCrimson@users.noreply.github.com> Date: Wed, 25 May 2022 21:25:15 -0700 Subject: [PATCH] Fix spelling of doneChoosing() (#9002) --- .../src/mage/player/ai/ComputerPlayer6.java | 10 +++++----- .../main/java/mage/player/ai/ComputerPlayer.java | 8 ++++---- .../src/mage/player/ai/ComputerPlayer2.java | 14 +++++++------- .../src/mage/player/human/HumanPlayer.java | 12 ++++++------ Mage/src/main/java/mage/target/Target.java | 2 +- Mage/src/main/java/mage/target/TargetAmount.java | 4 ++-- Mage/src/main/java/mage/target/TargetImpl.java | 8 ++++---- .../mage/target/common/TargetCardInLibrary.java | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java index 770d3b0aae..8a1a35e200 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java @@ -395,7 +395,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { if (effect != null && stackObject.getControllerId().equals(playerId)) { Target target = effect.getTarget(); - if (!target.doneChosing()) { + if (!target.doneChoosing()) { for (UUID targetId : target.possibleTargets(stackObject.getControllerId(), stackObject.getStackAbility(), game)) { Game sim = game.copy(); StackAbility newAbility = (StackAbility) stackObject.copy(); @@ -748,10 +748,10 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { if (targets.isEmpty()) { return super.chooseTarget(outcome, cards, target, source, game); } - if (!target.doneChosing()) { + if (!target.doneChoosing()) { for (UUID targetId : targets) { target.addTarget(targetId, source, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { targets.clear(); return true; } @@ -766,10 +766,10 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { if (targets.isEmpty()) { return super.choose(outcome, cards, target, game); } - if (!target.doneChosing()) { + if (!target.doneChoosing()) { for (UUID targetId : targets) { target.add(targetId, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { targets.clear(); return true; } diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 8393ebf864..8fa910fbec 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -247,7 +247,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { } // add the target target.add(permanent.getId(), game); - if (target.doneChosing()) { + if (target.doneChoosing()) { return true; } } @@ -1991,7 +1991,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { // we still use playerId when getting cards even if they don't control the search List cardChoices = new ArrayList<>(cards.getCards(target.getFilter(), playerId, source, game)); - while (!target.doneChosing()) { + while (!target.doneChoosing()) { Card card = pickTarget(abilityControllerId, cardChoices, outcome, target, source, game); if (card != null) { target.addTarget(card.getId(), source, game); @@ -2022,7 +2022,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { } List cardChoices = new ArrayList<>(cards.getCards(target.getFilter(), game)); - while (!target.doneChosing()) { + while (!target.doneChoosing()) { Card card = pickTarget(abilityControllerId, cardChoices, outcome, target, null, game); if (card != null) { target.add(card.getId(), game); @@ -2989,7 +2989,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { @Override public SpellAbility chooseAbilityForCast(Card card, Game game, boolean noMana) { Map useable = PlayerImpl.getCastableSpellAbilities(game, this.getId(), card, game.getState().getZone(card.getId()), noMana); - return (SpellAbility) useable.values().stream().findFirst().orElse(null); + return useable.values().stream().findFirst().orElse(null); } @Override diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java index 18c518cbd2..9ef6f27f8d 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java @@ -234,11 +234,11 @@ public class ComputerPlayer2 extends ComputerPlayer implements Player { SearchEffect effect = getSearchEffect((StackAbility) ability); if (effect != null && ability.getControllerId().equals(playerId)) { Target target = effect.getTarget(); - if (!target.doneChosing()) { + if (!target.doneChoosing()) { for (UUID targetId: target.possibleTargets(ability.getControllerId(), ability.getStackAbility(), game)) { Game sim = game.copy(); StackAbility newAbility = (StackAbility) ability.copy(); - SearchEffect newEffect = getSearchEffect((StackAbility) newAbility); + SearchEffect newEffect = getSearchEffect(newAbility); newEffect.getTarget().addTarget(targetId, newAbility, sim); sim.getStack().push(newAbility); SimulationNode newNode = new SimulationNode(node, sim, ability.getControllerId()); @@ -465,10 +465,10 @@ public class ComputerPlayer2 extends ComputerPlayer implements Player { public boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) { if (targets.isEmpty()) return super.chooseTarget(outcome, cards, target, source, game); - if (!target.doneChosing()) { + if (!target.doneChoosing()) { for (UUID targetId: targets) { target.addTarget(targetId, source, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { targets.clear(); return true; } @@ -482,10 +482,10 @@ public class ComputerPlayer2 extends ComputerPlayer implements Player { public boolean choose(Outcome outcome, Cards cards, TargetCard target, Game game) { if (targets.isEmpty()) return super.choose(outcome, cards, target, game); - if (!target.doneChosing()) { + if (!target.doneChoosing()) { for (UUID targetId: targets) { target.add(targetId, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { targets.clear(); return true; } @@ -717,7 +717,7 @@ public class ComputerPlayer2 extends ComputerPlayer implements Player { protected String indent(int num) { char[] fill = new char[num]; Arrays.fill(fill, ' '); - return Integer.toString(num) + new String(fill); + return num + new String(fill); } } diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 89f4d072dd..ea543e60c8 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -556,7 +556,7 @@ public class HumanPlayer extends PlayerImpl { if (target instanceof TargetPermanent) { if (((TargetPermanent) target).canTarget(abilityControllerId, responseId, source, game, false)) { target.add(responseId, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { return true; } } @@ -568,7 +568,7 @@ public class HumanPlayer extends PlayerImpl { target.remove(responseId); } else { target.addTarget(responseId, (Ability) object, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { return true; } } @@ -578,7 +578,7 @@ public class HumanPlayer extends PlayerImpl { target.remove(responseId); } else { target.addTarget(responseId, null, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { return true; } } @@ -646,7 +646,7 @@ public class HumanPlayer extends PlayerImpl { if (possibleTargets.contains(responseId)) { if (target.canTarget(abilityControllerId, responseId, source, game)) { target.addTarget(responseId, source, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { return true; } } @@ -733,7 +733,7 @@ public class HumanPlayer extends PlayerImpl { } else { if (target.canTarget(abilityControllerId, responseId, null, cards, game)) { target.add(responseId, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { return true; } } @@ -807,7 +807,7 @@ public class HumanPlayer extends PlayerImpl { target.remove(responseId); } else if (target.canTarget(abilityControllerId, responseId, source, cards, game)) { target.addTarget(responseId, source, game); - if (target.doneChosing()) { + if (target.doneChoosing()) { return true; } } diff --git a/Mage/src/main/java/mage/target/Target.java b/Mage/src/main/java/mage/target/Target.java index bcd3a87057..104a475f07 100644 --- a/Mage/src/main/java/mage/target/Target.java +++ b/Mage/src/main/java/mage/target/Target.java @@ -19,7 +19,7 @@ public interface Target extends Serializable { boolean isChosen(); - boolean doneChosing(); + boolean doneChoosing(); void clearChosen(); diff --git a/Mage/src/main/java/mage/target/TargetAmount.java b/Mage/src/main/java/mage/target/TargetAmount.java index 5fc1db14af..8e3c00e92e 100644 --- a/Mage/src/main/java/mage/target/TargetAmount.java +++ b/Mage/src/main/java/mage/target/TargetAmount.java @@ -45,11 +45,11 @@ public abstract class TargetAmount extends TargetImpl { @Override public boolean isChosen() { - return doneChosing(); + return doneChoosing(); } @Override - public boolean doneChosing() { + public boolean doneChoosing() { return amountWasSet && (remainingAmount == 0 || (getMinNumberOfTargets() < getMaxNumberOfTargets() diff --git a/Mage/src/main/java/mage/target/TargetImpl.java b/Mage/src/main/java/mage/target/TargetImpl.java index 7bb1ff0cc6..e539764f3a 100644 --- a/Mage/src/main/java/mage/target/TargetImpl.java +++ b/Mage/src/main/java/mage/target/TargetImpl.java @@ -9,12 +9,12 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.TargetEvent; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; import mage.util.RandomUtil; import java.util.*; -import mage.game.permanent.Permanent; /** * @author BetaSteward_at_googlemail.com @@ -175,7 +175,7 @@ public abstract class TargetImpl implements Target { } @Override - public boolean doneChosing() { + public boolean doneChoosing() { return getMaxNumberOfTargets() != 0 && targets.size() == getMaxNumberOfTargets(); } @@ -284,7 +284,7 @@ public abstract class TargetImpl implements Target { return chosen; } chosen = targets.size() >= getNumberOfTargets(); - } while (!isChosen() && !doneChosing()); + } while (!isChosen() && !doneChoosing()); return chosen; } @@ -321,7 +321,7 @@ public abstract class TargetImpl implements Target { return chosen; } chosen = targets.size() >= getNumberOfTargets(); - } while (!isChosen() && !doneChosing()); + } while (!isChosen() && !doneChoosing()); return chosen; } diff --git a/Mage/src/main/java/mage/target/common/TargetCardInLibrary.java b/Mage/src/main/java/mage/target/common/TargetCardInLibrary.java index c3fbe2ce8d..77647207a2 100644 --- a/Mage/src/main/java/mage/target/common/TargetCardInLibrary.java +++ b/Mage/src/main/java/mage/target/common/TargetCardInLibrary.java @@ -85,7 +85,7 @@ public class TargetCardInLibrary extends TargetCard { return chosen; } chosen = targets.size() >= getMinNumberOfTargets(); - } while (!isChosen() && !doneChosing()); + } while (!isChosen() && !doneChoosing()); return chosen; }