list.size > 0 changed to !list.isEmpty

We care about if it's empty or not, not about it's size
This commit is contained in:
vraskulin 2017-01-27 16:04:56 +03:00
parent f60ebfbb1f
commit 0557b5e89c
366 changed files with 532 additions and 548 deletions

View file

@ -98,7 +98,7 @@ class ActOnImpulseExileEffect extends OneShotEffect {
cards.add(card);
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
List<UUID> cardsId = new ArrayList<>();
for (Card card : cards) {
card.moveToExile(source.getSourceId(), "Act on Impulse", source.getSourceId(), game);

View file

@ -96,7 +96,7 @@ class AgonizingMemoriesEffect extends OneShotEffect {
}
private void chooseCardInHandAndPutOnTopOfLibrary(Game game, Ability source, Player you, Player targetPlayer) {
if (targetPlayer.getHand().size() > 0) {
if (!targetPlayer.getHand().isEmpty()) {
TargetCard target = new TargetCard(Zone.HAND, new FilterCard("card to put on the top of library (last chosen will be on top)"));
if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);

View file

@ -121,7 +121,7 @@ class AladdinsLampEffect extends ReplacementEffectImpl {
// Put the rest on the bottom of your library in a random order
while (cards.size() > 0) {
while (!cards.isEmpty()) {
Card card = cards.getRandom(game);
if (card != null) {
cards.remove(card);

View file

@ -95,7 +95,7 @@ class AltarOfDementiaEffect extends OneShotEffect {
if (player != null) {
int amount = 0;
for (Cost cost: source.getCosts()) {
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) {
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue();
break;
}

View file

@ -90,7 +90,7 @@ class AmassTheComponentsEffect extends OneShotEffect {
}
player.drawCards(3, game);
if (player.getHand().size() > 0) {
if (!player.getHand().isEmpty()) {
FilterCard filter = new FilterCard("card from your hand to put on the bottom of your library");
TargetCard target = new TargetCard(Zone.HAND, filter);

View file

@ -98,7 +98,7 @@ class AncestralMemoriesEffect extends OneShotEffect {
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
player.lookAtCards("Ancestral Memories", cards, game);
TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.LIBRARY, new FilterCard("two cards to put in your hand"));

View file

@ -106,7 +106,7 @@ class AngelOfSerenityTriggeredAbility extends ZoneChangeTriggeredAbility {
filter.add(new AnotherPredicate());
TargetCreaturePermanent target1 = new TargetCreaturePermanent(0, 3, filter, false);
game.getPlayer(getControllerId()).chooseTarget(Outcome.Exile, target1, this, game);
if (target1.getTargets().size() > 0) {
if (!target1.getTargets().isEmpty()) {
getTargets().add(target1);
}
@ -115,7 +115,7 @@ class AngelOfSerenityTriggeredAbility extends ZoneChangeTriggeredAbility {
FilterCard filter2 = new FilterCreatureCard("up to " + leftTargets + " target creature card" + (leftTargets > 1 ? "s" : "") + " from graveyards");
TargetCardInGraveyard target2 = new TargetCardInGraveyard(0, leftTargets, filter2);
game.getPlayer(getControllerId()).chooseTarget(Outcome.Exile, target2, this, game);
if (target2.getTargets().size() > 0) {
if (!target2.getTargets().isEmpty()) {
getTargets().add(target2);
}
}
@ -152,7 +152,7 @@ class AngelOfSerenityEnterEffect extends OneShotEffect {
boolean result = true;
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null && source.getTargets().size() > 0) {
if (controller != null && sourceObject != null && !source.getTargets().isEmpty()) {
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
for (Target target : source.getTargets()) {
if (target instanceof TargetCreaturePermanent) {

View file

@ -109,7 +109,7 @@ class AngelicArbiterWatcher2 extends Watcher {
&& game.getActivePlayerId().equals(event.getPlayerId())
&& game.getOpponents(controllerId).contains(event.getPlayerId())
&& game.getCombat().getAttackerId().equals(event.getPlayerId())
&& game.getCombat().getAttackers().size() > 0) {
&& !game.getCombat().getAttackers().isEmpty()) {
playersThatAttackedThisTurn.add(event.getPlayerId());
}
}

View file

@ -105,7 +105,7 @@ class AnimalBoneyardEffect extends OneShotEffect {
int toughness = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) {
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
toughness = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue();
break;
}

View file

@ -143,7 +143,7 @@ class AnimationModuleEffect extends OneShotEffect {
if (controller != null) {
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (permanent != null) {
if (permanent.getCounters(game).size() > 0) {
if (!permanent.getCounters(game).isEmpty()) {
if (permanent.getCounters(game).size() == 1) {
for (Counter counter : permanent.getCounters(game).values()) {
Counter newCounter = new Counter(counter.getName());
@ -172,7 +172,7 @@ class AnimationModuleEffect extends OneShotEffect {
else {
Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (player != null) {
if (player.getCounters().size() > 0) {
if (!player.getCounters().isEmpty()) {
if (player.getCounters().size() == 1) {
for (Counter counter : player.getCounters().values()) {
Counter newCounter = new Counter(counter.getName());

View file

@ -93,7 +93,7 @@ class AnimistsAwakeningEffect extends OneShotEffect {
Cards cards = new CardsImpl();
int xValue = source.getManaCostsToPay().getX();
cards.addAll(controller.getLibrary().getTopCards(game, xValue));
if (cards.size() > 0) {
if (!cards.isEmpty()) {
controller.revealCards(sourceObject.getIdName(), cards, game);
Set<Card> toBattlefield = new LinkedHashSet<>();
for (Card card : cards.getCards(new FilterLandCard(), source.getSourceId(), source.getControllerId(), game)) {

View file

@ -127,7 +127,7 @@ class AnyaMercilessAngelCondition implements Condition {
public static AnyaMercilessAngelCondition getInstance() {
return fInstance;
};
}
private AnyaMercilessAngelCondition() {}

View file

@ -176,7 +176,7 @@ class TargetCardInBaneAlleyBrokerExile extends TargetCardInExile {
if (sourceCard != null) {
UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
ExileZone exile = game.getExile().getExileZone(exileId);
if (exile != null && exile.size() > 0) {
if (exile != null && !exile.isEmpty()) {
possibleTargets.addAll(exile);
}
}
@ -189,7 +189,7 @@ class TargetCardInBaneAlleyBrokerExile extends TargetCardInExile {
if (sourceCard != null) {
UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
ExileZone exile = game.getExile().getExileZone(exileId);
if (exile != null && exile.size() > 0) {
if (exile != null && !exile.isEmpty()) {
return true;
}
}

View file

@ -95,7 +95,7 @@ class BirthingPodEffect extends OneShotEffect {
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost;
if (sacrificeCost.getPermanents().size() > 0) {
if (!sacrificeCost.getPermanents().isEmpty()) {
sacrificedPermanent = sacrificeCost.getPermanents().get(0);
}
break;

View file

@ -97,7 +97,7 @@ class BitterRevelationEffect extends OneShotEffect {
cards.add(card);
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
Cards cardsToHand = new CardsImpl();
player.lookAtCards("Bitter Revelation", cards, game);
TargetCard target = new TargetCard(Math.min(2, cards.size()), Zone.LIBRARY, new FilterCard("two cards to put in your hand"));

View file

@ -127,7 +127,7 @@ class BlessedReincarnationEffect extends OneShotEffect {
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
player.revealCards("BlessedReincarnation", cards, game);
Set<Card> cardsToShuffle = cards.getCards(game);
cardsToShuffle.remove(card);

View file

@ -136,7 +136,7 @@ class BorderlandExplorerEffect extends OneShotEffect {
if (cardsPlayer != null) {
TargetCardInLibrary target = new TargetCardInLibrary(0, 1, new FilterBasicLandCard());
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards cards = new CardsImpl(target.getTargets());
cards.addAll(target.getTargets());
cardsToReveal.put(playerId, cards);

View file

@ -110,7 +110,7 @@ class BrionStoutarmEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
int amount = 0;
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) {
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue();
break;
}

View file

@ -99,7 +99,7 @@ class BrowseEffect extends OneShotEffect {
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
player.lookAtCards("Browse", cards, game);
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));

View file

@ -278,7 +278,7 @@ class ChandraPyromasterEffect3 extends OneShotEffect {
cards.addAll(controller.getLibrary().getTopCards(game, 10));
controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), sourceObject.getIdName());
if (cards.getCards(new FilterInstantOrSorceryCard(), game).size() > 0) {
if (!cards.getCards(new FilterInstantOrSorceryCard(), game).isEmpty()) {
TargetCard target = new TargetCard(Zone.EXILED, new FilterInstantOrSorceryCard());
if (controller.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) {
Card card = cards.get(target.getFirstTarget(), game);

View file

@ -96,7 +96,7 @@ class ChimneyImpEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (targetOpponent != null) {
if (targetOpponent.getHand().size() > 0) {
if (!targetOpponent.getHand().isEmpty()) {
TargetCardInHand target = new TargetCardInHand();
target.setNotTarget(true);
target.setTargetName("a card from your hand to put on top of your library");

View file

@ -93,7 +93,7 @@ class ChitteringRatsEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player targetOpponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (targetOpponent != null) {
if (targetOpponent.getHand().size() > 0) {
if (!targetOpponent.getHand().isEmpty()) {
TargetCardInHand target = new TargetCardInHand();
target.setNotTarget(true);
target.setTargetName("a card from your hand to put on top of your library");

View file

@ -107,7 +107,7 @@ class ChromeMoxEffect extends OneShotEffect {
target.setNotTarget(true);
Card cardToImprint = null;
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (controller.getHand().size() > 0 && controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) {
if (!controller.getHand().isEmpty() && controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) {
cardToImprint = controller.getHand().get(target.getFirstTarget(), game);
}
if (sourcePermanent != null) {
@ -154,7 +154,7 @@ class ChromeMoxManaEffect extends ManaEffect {
Player player = game.getPlayer(source.getControllerId());
if (permanent != null && player != null) {
List<UUID> imprinted = permanent.getImprinted();
if (imprinted.size() > 0) {
if (!imprinted.isEmpty()) {
Card imprintedCard = game.getCard(imprinted.get(0));
if (imprintedCard != null) {
Choice choice = new ChoiceColor(true);
@ -177,7 +177,7 @@ class ChromeMoxManaEffect extends ManaEffect {
choice.getChoices().add("White");
}
if (choice.getChoices().size() > 0) {
if (!choice.getChoices().isEmpty()) {
Mana mana = new Mana();
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());

View file

@ -60,7 +60,7 @@ public class CircleOfProtectionWhite extends CardImpl {
// {1}: The next time a white source of your choice would deal damage to you this turn, prevent that damage.
Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));;
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1")));
}
public CircleOfProtectionWhite(final CircleOfProtectionWhite card) {

View file

@ -106,7 +106,7 @@ class CitanulFluteSearchEffect extends OneShotEffect {
TargetCardInLibrary target = new TargetCardInLibrary(filter);
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
Cards cards = new CardsImpl();
if (card != null){

View file

@ -94,7 +94,7 @@ class ClockspinningAddOrRemoveCounterEffect extends OneShotEffect {
private Counter selectCounterType(Game game, Ability source, Permanent permanent) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && permanent.getCounters(game).size() > 0) {
if (controller != null && !permanent.getCounters(game).isEmpty()) {
String counterName = null;
if (permanent.getCounters(game).size() > 1) {
Choice choice = new ChoiceImpl(true);
@ -122,7 +122,7 @@ class ClockspinningAddOrRemoveCounterEffect extends OneShotEffect {
private Counter selectCounterType(Game game, Ability source, Card card) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && card.getCounters(game).size() > 0) {
if (controller != null && !card.getCounters(game).isEmpty()) {
String counterName = null;
if (card.getCounters(game).size() > 1) {
Choice choice = new ChoiceImpl(true);

View file

@ -120,7 +120,7 @@ class CloneShellEffect extends OneShotEffect {
target1.clearChosen();
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
TargetCard target2 = new TargetCard(Zone.LIBRARY, filter2);
while (player.canRespond() && cards.size() > 1) {
player.choose(Outcome.Benefit, cards, target2, game);
@ -163,7 +163,7 @@ class CloneShellDiesEffect extends OneShotEffect {
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
if (permanent != null) {
List<UUID> imprinted = permanent.getImprinted();
if (imprinted.size() > 0) {
if (!imprinted.isEmpty()) {
Card imprintedCard = game.getCard(imprinted.get(0));
imprintedCard.setFaceDown(false, game);
if (imprintedCard.getCardType().contains(CardType.CREATURE)) {

View file

@ -117,7 +117,7 @@ class CobraTrapWatcher extends Watcher {
if (event.getType() == EventType.DESTROYED_PERMANENT) {
Permanent perm = (Permanent) game.getPermanentOrLKIBattlefield(event.getTargetId()); // can regenerate or be indestructible
if (perm != null && !perm.getCardType().contains(CardType.CREATURE)) {
if (game.getStack().size() > 0) {
if (!game.getStack().isEmpty()) {
StackObject spell = game.getStack().getStackObject(event.getSourceId());
if (spell != null && game.getOpponents(perm.getControllerId()).contains(spell.getControllerId())) {
players.add(perm.getControllerId());

View file

@ -109,7 +109,7 @@ class ConfluxEffect extends OneShotEffect {
if (you != null && you.getLibrary().size() > 0) {
if (you.searchLibrary(targetWhite, game)) {
if (targetWhite.getTargets().size() > 0) {
if (!targetWhite.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetWhite.getTargets()) {
Card card = you.getLibrary().remove(cardId, game);
if (card != null) {
@ -121,7 +121,7 @@ class ConfluxEffect extends OneShotEffect {
}
if (you != null && you.getLibrary().size() > 0) {
if (you.searchLibrary(targetBlue, game)) {
if (targetBlue.getTargets().size() > 0) {
if (!targetBlue.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetBlue.getTargets()) {
Card card = you.getLibrary().remove(cardId, game);
if (card != null) {
@ -133,7 +133,7 @@ class ConfluxEffect extends OneShotEffect {
}
if (you != null && you.getLibrary().size() > 0) {
if (you.searchLibrary(targetBlack, game)) {
if (targetBlack.getTargets().size() > 0) {
if (!targetBlack.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetBlack.getTargets()) {
Card card = you.getLibrary().remove(cardId, game);
if (card != null) {
@ -145,7 +145,7 @@ class ConfluxEffect extends OneShotEffect {
}
if (you != null && you.getLibrary().size() > 0) {
if (you.searchLibrary(targetRed, game)) {
if (targetRed.getTargets().size() > 0) {
if (!targetRed.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetRed.getTargets()) {
Card card = you.getLibrary().remove(cardId, game);
if (card != null) {
@ -157,7 +157,7 @@ class ConfluxEffect extends OneShotEffect {
}
if (you != null && you.getLibrary().size() > 0) {
if (you.searchLibrary(targetGreen, game)) {
if (targetGreen.getTargets().size() > 0) {
if (!targetGreen.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) targetGreen.getTargets()) {
Card card = you.getLibrary().remove(cardId, game);
if (card != null) {

View file

@ -95,7 +95,7 @@ class CongregationAtDawnEffect extends OneShotEffect {
if (controller != null && sourceObject != null) {
TargetCardInLibrary target = new TargetCardInLibrary(0, 3, new FilterCreatureCard("creature cards"));
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards revealed = new CardsImpl();
for (UUID cardId : (List<UUID>) target.getTargets()) {
Card card = controller.getLibrary().remove(cardId, game);

View file

@ -97,7 +97,7 @@ class SearchLibraryPutInGraveyard extends SearchEffect {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Card card = controller.getLibrary().getCard(target.getFirstTarget(), game);
if (card != null) {
controller.moveCards(card, Zone.GRAVEYARD, source, game);

View file

@ -136,7 +136,7 @@ class CorruptedGrafstoneManaEffect extends ManaEffect {
if (types.getWhite() > 0) {
choice.getChoices().add("White");
}
if (choice.getChoices().size() > 0) {
if (!choice.getChoices().isEmpty()) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {

View file

@ -98,7 +98,7 @@ class CultivateEffect extends OneShotEffect {
}
TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards revealed = new CardsImpl();
for (UUID cardId : target.getTargets()) {
Card card = controller.getLibrary().getCard(cardId, game);

View file

@ -140,7 +140,7 @@ class CurseOfChaosEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (attacker != null) {
if (attacker.getHand().size() > 0 && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){
if (!attacker.getHand().isEmpty() && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){
attacker.discard(1, false, source, game);
attacker.drawCards(1, game);
}

View file

@ -166,7 +166,7 @@ class CurseOfEchoesEffect extends OneShotEffect {
@Override
public String getText(Mode mode) {
if (mode.getTargets().size() > 0) {
if (!mode.getTargets().isEmpty()) {
return "Copy target " + mode.getTargets().get(0).getTargetName() + ". You may choose new targets for the copy";
}
return "No target";

View file

@ -93,7 +93,7 @@ class CursedScrollEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
if (sourceObject != null && controller != null && cardName != null && !cardName.isEmpty()) {
if (controller.getHand().size() > 0) {
if (!controller.getHand().isEmpty()) {
Cards revealed = new CardsImpl();
Card card = controller.getHand().getRandom(game);
revealed.add(card);

View file

@ -261,7 +261,7 @@ class DanceOfTheDeadChangeAbilityEffect extends ContinuousEffectImpl implements
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = affectedObjectList.get(0).getPermanent(game);;
Permanent permanent = affectedObjectList.get(0).getPermanent(game);
if (permanent != null) {
Ability abilityToRemove = null;
for (Ability ability : permanent.getAbilities()) {

View file

@ -116,7 +116,7 @@ class DarkSupplicantEffect extends OneShotEffect {
// Library check
if (player.chooseUse(Outcome.Benefit, "Do you want to search your library for Scion of Darkness?", source, game)) {
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
for (UUID cardId : (List<UUID>) target.getTargets()) {
Card card = player.getLibrary().getCard(cardId, game);
if (card != null) {

View file

@ -148,7 +148,7 @@ class TransmuteArtifactEffect extends SearchEffect {
}
}
if (sacrifice && controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
for (UUID cardId : target.getTargets()) {
Card card = controller.getLibrary().getCard(cardId, game);
if (card != null) {

View file

@ -107,7 +107,7 @@ class DementiaSliverEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
if (opponent != null && sourceObject != null && !cardName.isEmpty()) {
if (opponent.getHand().size() > 0) {
if (!opponent.getHand().isEmpty()) {
Cards revealed = new CardsImpl();
Card card = opponent.getHand().getRandom(game);
if (card != null) {

View file

@ -123,7 +123,7 @@ class DeployTheGatewatchEffect extends OneShotEffect {
}
// Put the rest on the bottom of your library in a random order
while (cards.size() > 0) {
while (!cards.isEmpty()) {
Card card = cards.getRandom(game);
if (card != null) {
cards.remove(card);

View file

@ -95,11 +95,11 @@ class DescendantOfMasumaroEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (controller != null && sourcePermanent != null) {
if (controller.getHand().size() > 0) {
if (!controller.getHand().isEmpty()) {
new AddCountersSourceEffect(CounterType.P1P1.createInstance(controller.getHand().size()), true).apply(game, source);
}
Player targetOpponent = game.getPlayer(getTargetPointer().getFirst(game, source));
if (targetOpponent != null && targetOpponent.getHand().size() > 0) {
if (targetOpponent != null && !targetOpponent.getHand().isEmpty()) {
sourcePermanent.removeCounters(CounterType.P1P1.getName(), targetOpponent.getHand().size(), game);
game.informPlayers(controller.getLogName() + " removes " + targetOpponent.getHand().size() + " +1/+1 counters from " + sourcePermanent.getLogName());
}

View file

@ -98,7 +98,7 @@ class DevoutInvocationEffect extends OneShotEffect {
Map<String, Serializable> options = new HashMap<>();
options.put("UI.right.btn.text", "Tapping complete");
controller.choose(outcome, target, source.getControllerId(), game, options);
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
UUID creature = target.getFirstTarget();
if (creature != null) {
game.getPermanent(creature).tap(game);

View file

@ -120,7 +120,7 @@ class DimirCharmEffect extends OneShotEffect {
cards.add(card);
}
}
if(cards.size() > 0){
if(!cards.isEmpty()){
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("Card to put back on top of library"));
if(controller.chooseTarget(Outcome.Benefit, cards, target, source, game)){
Card card = cards.get(target.getFirstTarget(), game);

View file

@ -108,7 +108,7 @@ class DimirMachinationsEffect extends OneShotEffect {
cards.remove(card);
}
}
while (cards.size() > 0) {
while (!cards.isEmpty()) {
if (cards.size() == 1) {
Card card = cards.get(cards.iterator().next(), game);
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, true, false);

View file

@ -125,7 +125,7 @@ class DivergentTransformationsEffect extends OneShotEffect {
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
player.revealCards(sourceObject.getIdName(), cards, game);
Set<Card> cardsToShuffle = cards.getCards(game);
cardsToShuffle.remove(card);

View file

@ -130,7 +130,7 @@ class DracoplasmEffect extends ReplacementEffectImpl {
return false;
}
controller.chooseTarget(Outcome.Detriment, target, source, game);
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
int power = 0;
int toughness = 0;
for (UUID targetId : target.getTargets()) {

View file

@ -121,7 +121,7 @@ class DralnusPetEffect extends OneShotEffect {
&& permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) {
int cmc = 0;
for (Cost cost : spellAbility.getCosts()) {
if (cost instanceof DiscardCardCost && ((DiscardCardCost) cost).getCards().size() > 0) {
if (cost instanceof DiscardCardCost && !((DiscardCardCost) cost).getCards().isEmpty()) {
cmc = ((DiscardCardCost) cost).getCards().get(0).getConvertedManaCost();
}
if (cmc > 0) {

View file

@ -143,7 +143,7 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if(permanent.getImprinted().size() > 0){
if(!permanent.getImprinted().isEmpty()){
Card card = game.getCard(permanent.getImprinted().get(0));
if(card != null && card.getCardType().contains(CardType.CREATURE))
{

View file

@ -96,7 +96,7 @@ class EldritchEvolutionEffect extends OneShotEffect {
for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost) {
SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost;
if (sacrificeCost.getPermanents().size() > 0) {
if (!sacrificeCost.getPermanents().isEmpty()) {
sacrificedPermanent = sacrificeCost.getPermanents().get(0);
}
break;

View file

@ -118,7 +118,7 @@ class EliteArcanistImprintEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player.getHand().size() > 0) {
if (!player.getHand().isEmpty()) {
TargetCard target = new TargetCard(Zone.HAND, filter);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
&& player.choose(Outcome.Benefit, player.getHand(), target, game)) {

View file

@ -105,7 +105,7 @@ class EndlessHorizonsEffect extends SearchEffect {
if (you != null) {
if (you.searchLibrary(target, game)) {
UUID exileZone = CardUtil.getCardExileZoneId(game, source);
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
for (UUID cardId : target.getTargets()) {
Card card = you.getLibrary().getCard(cardId, game);
if (card != null) {

View file

@ -101,7 +101,7 @@ class EpicExperimentEffect extends OneShotEffect {
return true;
}
cardsToCast.addAll(epicExperimentExileZone.getCards(filter, source.getSourceId(), source.getControllerId(), game));
while (cardsToCast.size() > 0) {
while (!cardsToCast.isEmpty()) {
if (!controller.chooseUse(Outcome.PlayForFree, "Cast (another) a card exiled with " + sourceObject.getLogName() + " without paying its mana cost?", source, game)) {
break;
}

View file

@ -91,8 +91,8 @@ public class Excavator extends CardImpl {
class ExcavatorEffect extends ContinuousEffectImpl implements SourceEffect {
private Abilities<Ability> abilities = new AbilitiesImpl();;
private Abilities<Ability> abilities = new AbilitiesImpl();
public ExcavatorEffect() {
super(Duration.EndOfTurn, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
setText("Target creature gains landwalk of each of the land types of the sacrificed land until end of turn");

View file

@ -128,7 +128,7 @@ class ExclusionRitualReplacementEffect extends ContinuousRuleModifyingEffectImpl
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Card card = game.getCard(event.getSourceId());
if (sourcePermanent != null && card != null) {
if (sourcePermanent.getImprinted().size() > 0) {
if (!sourcePermanent.getImprinted().isEmpty()) {
Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0));
if (imprintedCard != null) {
return card.getName().equals(imprintedCard.getName());

View file

@ -154,7 +154,7 @@ class EyeOfTheStormEffect1 extends OneShotEffect {
if (spellController.moveCardsToExile(spell, source, game, true, exileZoneId, eyeOfTheStorm.getIdName())) {
eyeOfTheStorm.imprint(card.getId(), game);
if (eyeOfTheStorm.getImprinted() != null && eyeOfTheStorm.getImprinted().size() > 0) {
if (eyeOfTheStorm.getImprinted() != null && !eyeOfTheStorm.getImprinted().isEmpty()) {
CardsImpl copiedCards = new CardsImpl();
for (UUID uuid : eyeOfTheStorm.getImprinted()) {
card = game.getCard(uuid);

View file

@ -95,7 +95,7 @@ class FirestormEffect extends OneShotEffect {
Player you = game.getPlayer(source.getControllerId());
int amount = (new GetXValue()).calculate(game, source, this);
if (you != null) {
if (source.getTargets().size() > 0) {
if (!source.getTargets().isEmpty()) {
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
Permanent creature = game.getPermanent(targetId);
if (creature != null) {

View file

@ -115,7 +115,7 @@ class FlamesOfRemembranceExileEffect extends OneShotEffect {
cards.add(card);
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
List<UUID> cardsId = new ArrayList<>();
for (Card card : cards) {
card.moveToExile(source.getSourceId(), "Flames of Remembrance", source.getSourceId(), game);

View file

@ -100,7 +100,7 @@ class FleshwritherEffect extends OneShotEffect {
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, sourceObject.getConvertedManaCost()));
TargetCardInLibrary target = new TargetCardInLibrary(1, filter);
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards chosen = new CardsImpl(target.getTargets());
controller.moveCards(chosen, Zone.BATTLEFIELD, source, game);
}

View file

@ -82,7 +82,7 @@ class FlingEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
int amount = 0;
for (Cost cost: source.getCosts()) {
if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) {
if (cost instanceof SacrificeTargetCost && !((SacrificeTargetCost) cost).getPermanents().isEmpty()) {
amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue();
break;
}

View file

@ -102,7 +102,7 @@ class ForbiddenAlchemyEffect extends OneShotEffect {
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
player.lookAtCards("Forbidden Alchemy", cards, game);
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));

View file

@ -96,7 +96,7 @@ class ForkInTheRoadEffect extends OneShotEffect {
}
TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards revealed = new CardsImpl();
for (UUID cardId : target.getTargets()) {
Card card = game.getCard(cardId);
@ -105,7 +105,7 @@ class ForkInTheRoadEffect extends OneShotEffect {
}
}
controller.revealCards(sourceObject.getIdName(), revealed, game);
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
TargetCard target2 = new TargetCard(Zone.LIBRARY, filter);
controller.choose(Outcome.Benefit, revealed, target2, game);
Card card = revealed.get(target2.getFirstTarget(), game);

View file

@ -93,7 +93,7 @@ class FriendlyFireEffect extends OneShotEffect {
if (targetCreature != null) {
Player controllerOfTargetCreature = game.getPlayer(targetCreature.getControllerId());
if (controllerOfTargetCreature != null) {
if (controllerOfTargetCreature.getHand().size() > 0) {
if (!controllerOfTargetCreature.getHand().isEmpty()) {
Cards cards = new CardsImpl();
Card card = controllerOfTargetCreature.getHand().getRandom(game);
cards.add(card);

View file

@ -108,7 +108,7 @@ class FromTheAshesEffect extends OneShotEffect {
if (player != null) {
TargetCardInLibrary target = new TargetCardInLibrary(0, entry.getValue(), new FilterBasicLandCard());
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
for (UUID cardId: target.getTargets()) {
Card card = player.getLibrary().getCard(cardId, game);
if (card != null) {

View file

@ -45,8 +45,6 @@ public class GaeasCradle extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature you control");
;
static {
filter.add(new CardTypePredicate(CardType.CREATURE));
}

View file

@ -103,7 +103,7 @@ class GallowsAtWillowHillEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int affectedTargets = 0;
if (targetPointer.getTargets(game, source).size() > 0) {
if (!targetPointer.getTargets(game, source).isEmpty()) {
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {

View file

@ -179,7 +179,7 @@ class GarrukTheVeilCursedEffect extends OneShotEffect {
}
}
// reveal
if (cards.size() > 0) {
if (!cards.isEmpty()) {
controller.revealCards("Garruk, the Veil-Cursed", cards, game);
}
// shuffle

View file

@ -100,13 +100,13 @@ class GatherThePackEffect extends OneShotEffect {
TargetCard target = new TargetCard(0, max, Zone.LIBRARY, new FilterCreatureCard("creature card" + (max > 1 ? "s" : "") + " to put into your hand"));
if (controller.choose(Outcome.PutCreatureInPlay, cards, target, game)) {
Cards cardsToHand = new CardsImpl(target.getTargets());
if (cardsToHand.size() > 0) {
if (!cardsToHand.isEmpty()) {
cards.removeAll(cardsToHand);
controller.moveCards(cardsToHand, Zone.HAND, source, game);
}
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
}
}

View file

@ -116,7 +116,7 @@ class GenesisHydraPutOntoBattlefieldEffect extends OneShotEffect {
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
controller.revealCards("Genesis Hydra", cards, game);
}

View file

@ -101,7 +101,7 @@ class GenesisWaveEffect extends OneShotEffect {
Card card = controller.getLibrary().removeFromTop(game);
cards.add(card);
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
controller.revealCards(sourceObject.getIdName(), cards, game);
FilterCard filter = new FilterCard("cards with converted mana cost " + xValue + " or less to put onto the battlefield");
filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, xValue + 1));

View file

@ -107,7 +107,7 @@ class GhastlyDemiseEffect extends OneShotEffect {
}
}
}
} else if (targetPointer.getTargets(game, source).size() > 0) {
} else if (!targetPointer.getTargets(game, source).isEmpty()) {
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().size()) {

View file

@ -98,7 +98,7 @@ class GiftsUngivenEffect extends OneShotEffect {
}
GiftsUngivenTarget target = new GiftsUngivenTarget();
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards cards = new CardsImpl();
for (UUID cardId : target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);

View file

@ -97,7 +97,7 @@ class GlimpseTheFutureEffect extends OneShotEffect {
}
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
controller.lookAtCards("Glimpse the Future", cards, game);
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));

View file

@ -139,7 +139,7 @@ class GodsendTriggeredAbility extends TriggeredAbilityImpl {
}
targetName = "a creature blocked by creature ";
}
if (possibleTargets.size() > 0) {
if (!possibleTargets.isEmpty()) {
this.getTargets().clear();
if (possibleTargets.size() == 1) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(possibleTargets.iterator().next()));

View file

@ -189,7 +189,7 @@ class GrinningTotemDelayedTriggeredAbility extends DelayedTriggeredAbility {
@Override
public boolean checkInterveningIfClause(Game game) {
ExileZone exileZone = game.getExile().getExileZone(exileZoneId);
return exileZone != null && exileZone.getCards(game).size() > 0;
return exileZone != null && !exileZone.getCards(game).isEmpty();
}
@Override

View file

@ -153,7 +153,7 @@ class GripOfChaosEffect extends OneShotEffect {
for (Target target : mode.getTargets()) {
UUID oldTargetId = target.getFirstTarget();
Set<UUID> possibleTargets = target.possibleTargets(stackObject.getSourceId(), stackObject.getControllerId(), game);
if (possibleTargets.size() > 0) {
if (!possibleTargets.isEmpty()) {
int i = 0;
int rnd = RandomUtil.nextInt(possibleTargets.size());
Iterator<UUID> it = possibleTargets.iterator();

View file

@ -118,7 +118,7 @@ class GrozothEffect extends SearchEffect {
Player player = game.getPlayer(source.getControllerId());
Card sourceCard = game.getCard(source.getSourceId());
if (sourceCard != null && player != null && player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards cards = new CardsImpl();
for (UUID cardId : target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);

View file

@ -100,7 +100,7 @@ class GurmagDrownerEffect extends OneShotEffect {
if (controller != null && sourceObject != null) {
Cards cards = new CardsImpl();
cards.addAll(controller.getLibrary().getTopCards(game, 4));
if (cards.size() > 0) {
if (!cards.isEmpty()) {
controller.lookAtCards(sourceObject.getName(), cards, game);
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put in your hand"));
if (controller.choose(Outcome.Benefit, cards, target, game)) {

View file

@ -99,7 +99,7 @@ class HarmonyOfNatureEffect extends OneShotEffect {
Map<String, Serializable> options = new HashMap<>();
options.put("UI.right.btn.text", "Tapping complete");
controller.choose(outcome, target, source.getControllerId(), game, options);
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
UUID creature = target.getFirstTarget();
if (creature != null) {
game.getPermanent(creature).tap(game);

View file

@ -137,7 +137,7 @@ class HeartOfKiranAlternateCrewCost extends CostImpl {
@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
return game.getBattlefield().getAllActivePermanents(filter, game).size() > 0;
return !game.getBattlefield().getAllActivePermanents(filter, game).isEmpty();
}
@Override

View file

@ -100,7 +100,7 @@ class HellcarverDemonEffect extends OneShotEffect {
}
}
if (player != null && player.getHand().size() > 0) {
if (player != null && !player.getHand().isEmpty()) {
int cardsInHand = player.getHand().size();
player.discard(cardsInHand, source, game);
}

View file

@ -188,7 +188,7 @@ class HeroesPodiumEffect extends OneShotEffect {
}
// Put the rest on the bottom of your library in a random order
while (cards.size() > 0) {
while (!cards.isEmpty()) {
Card card = cards.getRandom(game);
if (card != null) {
cards.remove(card);

View file

@ -101,7 +101,7 @@ class HiredTorturerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null && player.getHand().size() > 0) {
if (player != null && !player.getHand().isEmpty()) {
Cards revealed = new CardsImpl();
revealed.add(player.getHand().getRandom(game));
player.revealCards("Hired Torturer", revealed, game);

View file

@ -122,7 +122,7 @@ class HisokasGuardGainAbilityTargetEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
Permanent hisokasGuard = game.getPermanent(source.getSourceId());
if (hisokasGuard != null && hisokasGuard.getConnectedCards("HisokasGuard").size() > 0) {
if (hisokasGuard != null && !hisokasGuard.getConnectedCards("HisokasGuard").isEmpty()) {
Permanent guardedCreature = game.getPermanent(hisokasGuard.getConnectedCards("HisokasGuard").get(0));
if (guardedCreature != null && hisokasGuard.isTapped()) {
guardedCreature.addAbility(ability, game);

View file

@ -105,7 +105,7 @@ class HoardingDragonEffect extends OneShotEffect {
if (controller != null && sourceObject != null) {
TargetCardInLibrary target = new TargetCardInLibrary(new FilterArtifactCard());
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Card card = controller.getLibrary().getCard(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);

View file

@ -84,7 +84,7 @@ public class HopeOfGhirapur extends CardImpl {
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof SimpleActivatedAbility) {
if (ability.getEffects().size() > 0 && (ability.getEffects().get(0) instanceof HopeOfGhirapurCantCastEffect)) {
if (!ability.getEffects().isEmpty() && (ability.getEffects().get(0) instanceof HopeOfGhirapurCantCastEffect)) {
MageObject sourceObject = ability.getSourceObject(game);
if (sourceObject != null) {
ability.getTargets().clear();

View file

@ -85,7 +85,7 @@ class IgniteMemoriesEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player != null && player.getHand().size() > 0) {
if (player != null && !player.getHand().isEmpty()) {
Cards revealed = new CardsImpl();
Card card = player.getHand().getRandom(game);
revealed.add(card);

View file

@ -96,7 +96,7 @@ class InameDeathAspectEffect extends SearchEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null && player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
player.moveCards(new CardsImpl(target.getTargets()), Zone.GRAVEYARD, source, game);
}
player.shuffleLibrary(source, game);

View file

@ -103,7 +103,7 @@ class IncreasingAmbitionEffect extends SearchEffect {
target = new TargetCardInLibrary();
}
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
for (UUID cardId: (List<UUID>)target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);
if (card != null) {

View file

@ -147,7 +147,7 @@ class IndomitableCreativityEffect extends OneShotEffect {
controllerOfDestroyedCreature.moveCards(card, Zone.BATTLEFIELD, source, game);
}
if (cards.size() > 0) {
if (!cards.isEmpty()) {
revealCards.addAll(cards);
Set<Card> cardsToShuffle = cards.getCards(game);
cardsToShuffle.remove(card);

View file

@ -108,7 +108,7 @@ class InfernalKirinEffect extends OneShotEffect {
}
}
if (targetPlayer != null) {
if (targetPlayer.getHand().size() > 0) {
if (!targetPlayer.getHand().isEmpty()) {
targetPlayer.revealCards("Infernal Kirin", targetPlayer.getHand(), game);
for (UUID uuid: targetPlayer.getHand().copy()) {
Card card = game.getCard(uuid);

View file

@ -101,7 +101,7 @@ class InfernalTutorEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
if (controller.getHand().size() > 0) {
if (!controller.getHand().isEmpty()) {
Card cardToReveal = null;
if (controller.getHand().size() > 1) {
Target target = new TargetCardInHand(new FilterCard());

View file

@ -133,7 +133,7 @@ class InvaderParasiteTriggeredAbility extends TriggeredAbilityImpl {
Permanent targetPermanent = game.getPermanent(event.getTargetId());
Permanent sourcePermanent = game.getPermanent(getSourceId());
if (targetPermanent != null && sourcePermanent != null) {
if (sourcePermanent.getImprinted().size() > 0) {
if (!sourcePermanent.getImprinted().isEmpty()) {
Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0));
if (imprintedCard != null && targetPermanent.getName().equals(imprintedCard.getName())) {
for (Effect effect : this.getEffects()) {

View file

@ -103,7 +103,7 @@ class IsochronScepterImprintEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller != null) {
if (controller.getHand().size() > 0) {
if (!controller.getHand().isEmpty()) {
TargetCard target = new TargetCard(Zone.HAND, filter);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
&& controller.choose(Outcome.Benefit, controller.getHand(), target, game)) {

View file

@ -122,7 +122,7 @@ class JaceMindseekerEffect extends OneShotEffect {
}
// cast an instant or sorcery for free
if (cardsToCast.size() > 0) {
if (!cardsToCast.isEmpty()) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
TargetCard target = new TargetCard(Zone.GRAVEYARD, filter); // zone should be ignored here

View file

@ -92,7 +92,7 @@ class JaradsOrdersEffect extends OneShotEffect {
if (controller != null) {
TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterCreatureCard("creature cards"));
if (controller.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
Cards revealed = new CardsImpl();
for (UUID cardId: (List<UUID>)target.getTargets()) {
Card card = controller.getLibrary().getCard(cardId, game);

View file

@ -191,7 +191,7 @@ class JestersScepterCost extends CostImpl {
TargetCardInExile target = new TargetCardInExile(new FilterCard(), CardUtil.getCardExileZoneId(game, ability));
target.setNotTarget(true);
Cards cards = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, ability));
if (cards.size() > 0
if (!cards.isEmpty()
&& controller.choose(Outcome.Benefit, cards, target, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {

View file

@ -153,7 +153,7 @@ class KaaliaOfTheVastEffect extends OneShotEffect {
}
TargetCardInHand target = new TargetCardInHand(filter);
if (target.canChoose(controller.getId(), game) && target.choose(getOutcome(), controller.getId(), source.getSourceId(), game)) {
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
UUID cardId = target.getFirstTarget();
Card card = game.getCard(cardId);
if (card != null && game.getCombat() != null) {

View file

@ -117,7 +117,7 @@ class KahoMinamoHistorianEffect extends SearchEffect {
if (controller != null && sourceObject != null) {
if (controller.searchLibrary(target, game)) {
UUID exileZone = CardUtil.getCardExileZoneId(game, source);
if (target.getTargets().size() > 0) {
if (!target.getTargets().isEmpty()) {
controller.moveCardsToExile(new CardsImpl(target.getTargets()).getCards(game), source, game, true, exileZone, sourceObject.getIdName());
}
}
@ -153,7 +153,7 @@ class KahoMinamoHistorianCastEffect extends OneShotEffect {
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, source.getManaCostsToPay().getX()));
TargetCardInExile target = new TargetCardInExile(filter, CardUtil.getCardExileZoneId(game, source));
Cards cards = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
if (cards.size() > 0 && controller.choose(Outcome.PlayForFree, cards, target, game)) {
if (!cards.isEmpty() && controller.choose(Outcome.PlayForFree, cards, target, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
controller.cast(card.getSpellAbility(), game, true);

View file

@ -127,10 +127,10 @@ class KangeeAerieKeeperGetKickerXValue implements DynamicValue {
@Override
public String toString() {
return "X";
};
}
@Override
public String getMessage() {
return "X";
};
}
}

Some files were not shown because too many files have changed in this diff Show more