mirror of
https://github.com/correl/mage.git
synced 2024-11-25 11:09:53 +00:00
Fix spelling of doneChoosing() (#9002)
This commit is contained in:
parent
1e61efb90e
commit
0c8ef41012
8 changed files with 30 additions and 30 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<Card> 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<Card> 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<UUID, SpellAbility> 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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public interface Target extends Serializable {
|
|||
|
||||
boolean isChosen();
|
||||
|
||||
boolean doneChosing();
|
||||
boolean doneChoosing();
|
||||
|
||||
void clearChosen();
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class TargetCardInLibrary extends TargetCard {
|
|||
return chosen;
|
||||
}
|
||||
chosen = targets.size() >= getMinNumberOfTargets();
|
||||
} while (!isChosen() && !doneChosing());
|
||||
} while (!isChosen() && !doneChoosing());
|
||||
return chosen;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue