From 89ac77e28a3f1a0726286dc9476aff37ba0ab925 Mon Sep 17 00:00:00 2001 From: igoudt Date: Sat, 29 Jul 2017 23:55:11 +0200 Subject: [PATCH] clean ups, talk to interface rather than implementation --- Mage.Sets/src/mage/cards/a/Aetherspouts.java | 12 +++--- .../src/mage/cards/a/ArsenalThresher.java | 8 ++-- Mage.Sets/src/mage/cards/b/Balance.java | 8 ++-- Mage.Sets/src/mage/cards/b/BlastfireBolt.java | 8 ++-- .../src/mage/cards/b/BorderlandExplorer.java | 5 ++- .../src/mage/cards/c/CallToTheKindred.java | 8 ++-- .../src/mage/cards/c/CapriciousEfreet.java | 8 ++-- .../src/mage/cards/c/CarpetOfFlowers.java | 8 ++-- Mage.Sets/src/mage/cards/c/Counterlash.java | 8 ++-- Mage.Sets/src/mage/cards/c/CracklingDoom.java | 8 ++-- .../src/mage/cards/c/CryptOfTheEternals.java | 8 ++-- .../src/mage/cards/c/CrypticGateway.java | 9 ++-- Mage.Sets/src/mage/cards/c/CustodiSquire.java | 8 ++-- Mage.Sets/src/mage/cards/d/DeadlyTempest.java | 12 +++--- .../src/mage/cards/d/DescentOfTheDragons.java | 8 ++-- Mage.Sets/src/mage/cards/d/DroidFactory.java | 8 ++-- .../src/mage/cards/d/DwarvenArmorer.java | 8 ++-- .../src/mage/cards/e/EmptyShrineKannushi.java | 8 ++-- .../src/mage/cards/e/EndHostilities.java | 8 ++-- .../src/mage/cards/e/ErdwalIlluminator.java | 8 ++-- .../src/mage/cards/e/EyeOfSingularity.java | 14 ++++--- Mage.Sets/src/mage/cards/f/FaithsReward.java | 8 ++-- .../src/mage/cards/f/FalkenrathGorger.java | 12 +++--- Mage.Sets/src/mage/cards/f/Fatespinner.java | 8 ++-- Mage.Sets/src/mage/cards/f/FiveAlarmFire.java | 8 ++-- .../src/mage/cards/f/FlowstoneSculpture.java | 8 ++-- .../src/mage/cards/f/ForgottenAncient.java | 8 ++-- .../src/mage/cards/g/GazeOfTheGorgon.java | 8 ++-- .../src/mage/cards/g/GhastlyConscription.java | 5 ++- .../src/mage/cards/h/HarmonicConvergence.java | 7 +--- .../src/mage/cards/h/HedonistsTrove.java | 14 +++---- .../mage/cards/i/IndomitableCreativity.java | 16 +++----- Mage.Sets/src/mage/cards/j/JediEnclave.java | 8 ++-- Mage.Sets/src/mage/cards/j/JodahsAvenger.java | 15 +++---- Mage.Sets/src/mage/cards/j/JungleVillage.java | 8 ++-- Mage.Sets/src/mage/cards/k/KillingWave.java | 10 ++--- .../mage/cards/k/KynaiosAndTiroOfMeletis.java | 10 +++-- Mage.Sets/src/mage/cards/l/LunarAvenger.java | 8 ++-- .../src/mage/cards/m/MaintenanceDroid.java | 8 ++-- Mage.Sets/src/mage/cards/m/MarchOfSouls.java | 10 +++-- Mage.Sets/src/mage/cards/m/MartyrsBond.java | 9 ++-- Mage.Sets/src/mage/cards/m/MenacingOgre.java | 8 ++-- Mage.Sets/src/mage/cards/m/Mindblaze.java | 8 ++-- .../src/mage/cards/m/MitoticManipulation.java | 10 +++-- .../src/mage/cards/m/MultiformWonder.java | 15 +++---- .../mage/cards/n/NecromanticSelection.java | 14 +++---- .../mage/cards/n/NicolBolasGodPharaoh.java | 21 ++++------ .../src/mage/cards/n/NoRestForTheWicked.java | 14 +++---- .../src/mage/cards/n/NyleasPresence.java | 41 ++++++++----------- .../src/mage/cards/o/OrzhovAdvokist.java | 12 +++--- Mage.Sets/src/mage/cards/p/PlanarOverlay.java | 11 ++--- Mage.Sets/src/mage/cards/p/PrismaticOmen.java | 37 +++++++---------- .../src/mage/cards/r/RallyTheAncestors.java | 10 +++-- Mage.Sets/src/mage/cards/r/ReapIntellect.java | 15 +++---- .../src/mage/cards/r/ReinsOfTheVinesteed.java | 8 ++-- .../src/mage/cards/r/RestoreBalance.java | 14 +++---- Mage.Sets/src/mage/cards/r/RiteOfRuin.java | 9 ++-- .../src/mage/cards/s/SavageSummoning.java | 19 +++------ Mage.Sets/src/mage/cards/s/ScytheSpecter.java | 10 +++-- Mage.Sets/src/mage/cards/s/SecondSunrise.java | 8 ++-- Mage.Sets/src/mage/cards/s/Shapeshifter.java | 24 +++++------ .../src/mage/cards/s/SharedAnimosity.java | 8 ++-- .../src/mage/cards/s/SilenceTheBelievers.java | 8 ++-- Mage.Sets/src/mage/cards/s/SithEvoker.java | 8 ++-- Mage.Sets/src/mage/cards/s/SithRuins.java | 8 ++-- Mage.Sets/src/mage/cards/s/SoulOfRavnica.java | 8 ++-- .../src/mage/cards/s/SpiritOfResistance.java | 8 ++-- .../mage/cards/s/SpiritOfTheLabyrinth.java | 8 ++-- Mage.Sets/src/mage/cards/s/StorageMatrix.java | 8 ++-- .../src/mage/cards/s/SunderingTitan.java | 11 ++--- .../mage/cards/t/TamiyoFieldResearcher.java | 9 ++-- Mage.Sets/src/mage/cards/t/Tarmogoyf.java | 15 +++---- Mage.Sets/src/mage/cards/t/TeferisRealm.java | 8 ++-- Mage.Sets/src/mage/cards/t/Terastodon.java | 10 +++-- .../src/mage/cards/t/ThatcherRevolt.java | 8 ++-- Mage.Sets/src/mage/cards/t/ThranTurbine.java | 8 ++-- Mage.Sets/src/mage/cards/t/Turnabout.java | 10 +++-- Mage.Sets/src/mage/cards/t/Twinflame.java | 8 ++-- .../src/mage/cards/t/TymnaTheWeaver.java | 10 ++--- Mage.Sets/src/mage/cards/u/UbaMask.java | 15 ++----- .../src/mage/cards/u/UnderworldSlums.java | 8 ++-- Mage.Sets/src/mage/cards/u/UrzasMiter.java | 8 ++-- Mage.Sets/src/mage/cards/v/VileRedeemer.java | 8 ++-- .../src/mage/cards/v/VoraciousDragon.java | 7 ++-- Mage.Sets/src/mage/cards/w/WakeTheDead.java | 8 ++-- Mage.Sets/src/mage/cards/w/WitchbaneOrb.java | 8 ++-- Mage.Sets/src/mage/cards/w/WorldQueller.java | 9 ++-- .../src/main/java/mage/constants/SubType.java | 7 ++-- .../main/java/mage/filter/StaticFilters.java | 23 +++++++++++ Mage/src/main/java/mage/game/GameImpl.java | 28 +++---------- 90 files changed, 509 insertions(+), 457 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/Aetherspouts.java b/Mage.Sets/src/mage/cards/a/Aetherspouts.java index f4d11cda39..3e8466c206 100644 --- a/Mage.Sets/src/mage/cards/a/Aetherspouts.java +++ b/Mage.Sets/src/mage/cards/a/Aetherspouts.java @@ -27,8 +27,6 @@ */ package mage.cards.a; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.*; @@ -44,6 +42,10 @@ import mage.players.Player; import mage.players.PlayerList; import mage.target.TargetCard; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -102,8 +104,8 @@ class AetherspoutsEffect extends OneShotEffect { Player player = game.getPlayer(game.getActivePlayerId()); Player activePlayer = player; do { - ArrayList permanentsToTop = new ArrayList<>(); - ArrayList permanentsToBottom = new ArrayList<>(); + List permanentsToTop = new ArrayList<>(); + List permanentsToBottom = new ArrayList<>(); for (Permanent permanent:game.getState().getBattlefield().getActivePermanents(new FilterAttackingCreature(), player.getId(), source.getSourceId(), game)) { if (permanent.getOwnerId().equals(player.getId())) { if (player.chooseUse(outcome, "Put " + permanent.getLogName() + " to the top? (else it goes to bottom)", source, game)) { @@ -117,7 +119,7 @@ class AetherspoutsEffect extends OneShotEffect { } // cards to top Cards cards = new CardsImpl(); - ArrayList toLibrary = new ArrayList<>(); + List toLibrary = new ArrayList<>(); for (Permanent permanent: permanentsToTop) { if (permanent instanceof PermanentToken) { toLibrary.add(permanent); diff --git a/Mage.Sets/src/mage/cards/a/ArsenalThresher.java b/Mage.Sets/src/mage/cards/a/ArsenalThresher.java index 925ac2da93..4ec764a971 100644 --- a/Mage.Sets/src/mage/cards/a/ArsenalThresher.java +++ b/Mage.Sets/src/mage/cards/a/ArsenalThresher.java @@ -27,8 +27,6 @@ */ package mage.cards.a; -import java.util.ArrayList; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -48,6 +46,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInHand; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -110,7 +112,7 @@ class ArsenalThresherEffect extends OneShotEffect { } if (arsenalThresher != null) { controller.revealCards(arsenalThresher.getIdName(), cards, game); - ArrayList appliedEffects = (ArrayList) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event + List appliedEffects = (ArrayList) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event arsenalThresher.addCounters(CounterType.P1P1.createInstance(cards.size()), source, game, appliedEffects); } } diff --git a/Mage.Sets/src/mage/cards/b/Balance.java b/Mage.Sets/src/mage/cards/b/Balance.java index f44a8a49f2..8bb7ed6ded 100644 --- a/Mage.Sets/src/mage/cards/b/Balance.java +++ b/Mage.Sets/src/mage/cards/b/Balance.java @@ -27,8 +27,6 @@ */ package mage.cards.b; -import java.util.HashMap; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.*; @@ -43,6 +41,10 @@ import mage.players.Player; import mage.target.common.TargetCardInHand; import mage.target.common.TargetControlledPermanent; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author emerald000 @@ -156,7 +158,7 @@ class BalanceEffect extends OneShotEffect { //Cards in hand int minCard = Integer.MAX_VALUE; - HashMap cardsToDiscard = new HashMap<>(2); + Map cardsToDiscard = new HashMap<>(2); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/b/BlastfireBolt.java b/Mage.Sets/src/mage/cards/b/BlastfireBolt.java index ea0ce6df85..723e024368 100644 --- a/Mage.Sets/src/mage/cards/b/BlastfireBolt.java +++ b/Mage.Sets/src/mage/cards/b/BlastfireBolt.java @@ -27,8 +27,6 @@ */ package mage.cards.b; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; @@ -41,6 +39,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Quercitron @@ -89,7 +91,7 @@ class DestroyAllAttachedEquipmentEffect extends OneShotEffect { if (controller != null) { Permanent target = game.getPermanent(source.getFirstTarget()); if (target != null) { - ArrayList attachments = new ArrayList<>(target.getAttachments()); + List attachments = new ArrayList<>(target.getAttachments()); for (UUID attachmentId : attachments) { Permanent attachment = game.getPermanent(attachmentId); if (attachment != null && attachment.getSubtype(game).contains("Equipment")) { diff --git a/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java b/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java index c45fe1d49a..45d4e97e35 100644 --- a/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java +++ b/Mage.Sets/src/mage/cards/b/BorderlandExplorer.java @@ -44,6 +44,7 @@ import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetDiscard; import java.util.HashMap; +import java.util.Map; import java.util.UUID; /** @@ -95,9 +96,9 @@ class BorderlandExplorerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); // Store for each player the cards to discard, that's important because all discard shall happen at the same time - HashMap cardsToDiscard = new HashMap<>(); + Map cardsToDiscard = new HashMap<>(); // Store for each player the lands to reveal, that's important because all reveals shall happen at the same time - HashMap cardsToReveal = new HashMap<>(); + Map cardsToReveal = new HashMap<>(); if (controller != null) { // choose cards to discard for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { diff --git a/Mage.Sets/src/mage/cards/c/CallToTheKindred.java b/Mage.Sets/src/mage/cards/c/CallToTheKindred.java index 7e2d3a616e..84aefe9db6 100644 --- a/Mage.Sets/src/mage/cards/c/CallToTheKindred.java +++ b/Mage.Sets/src/mage/cards/c/CallToTheKindred.java @@ -27,8 +27,6 @@ */ package mage.cards.c; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; @@ -53,6 +51,10 @@ import mage.target.TargetCard; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author North @@ -122,7 +124,7 @@ class CallToTheKindredEffect extends OneShotEffect { if (!creature.getAbilities().contains(ChangelingAbility.getInstance())) { StringBuilder sb = new StringBuilder("creature card with at least one subtype from: "); - ArrayList> subtypes = new ArrayList<>(); + List> subtypes = new ArrayList<>(); for (SubType subtype : creature.getSubtype(game)) { subtypes.add(new SubtypePredicate(subtype)); sb.append(subtype).append(", "); diff --git a/Mage.Sets/src/mage/cards/c/CapriciousEfreet.java b/Mage.Sets/src/mage/cards/c/CapriciousEfreet.java index 08ef7263b5..3e271eb297 100644 --- a/Mage.Sets/src/mage/cards/c/CapriciousEfreet.java +++ b/Mage.Sets/src/mage/cards/c/CapriciousEfreet.java @@ -27,8 +27,6 @@ */ package mage.cards.c; -import java.util.ArrayList; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -45,6 +43,10 @@ import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.util.RandomUtil; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author North @@ -101,7 +103,7 @@ class CapriciousEfreetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - ArrayList targetPermanents = new ArrayList<>(); + List targetPermanents = new ArrayList<>(); Permanent permanent = game.getPermanent(source.getTargets().get(0).getFirstTarget()); if (permanent != null) { targetPermanents.add(permanent); diff --git a/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java b/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java index 3471e7dd52..d320f00f06 100644 --- a/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java +++ b/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java @@ -27,8 +27,6 @@ */ package mage.cards.c; -import java.util.LinkedHashSet; -import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -50,6 +48,10 @@ import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetOpponent; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Plopman @@ -163,7 +165,7 @@ class CarpetOfFlowersEffect extends ManaEffect { } int countMax = game.getBattlefield().count(filter, source.getSourceId(), source.getTargets().getFirstTarget(), game); ChoiceImpl choiceCount = new ChoiceImpl(true); - LinkedHashSet set = new LinkedHashSet<>(countMax + 1); + Set set = new LinkedHashSet<>(countMax + 1); for (int i = 0; i <= countMax; i++) { set.add(Integer.toString(i)); } diff --git a/Mage.Sets/src/mage/cards/c/Counterlash.java b/Mage.Sets/src/mage/cards/c/Counterlash.java index 802ae542bd..b1ad8d9225 100644 --- a/Mage.Sets/src/mage/cards/c/Counterlash.java +++ b/Mage.Sets/src/mage/cards/c/Counterlash.java @@ -27,8 +27,6 @@ */ package mage.cards.c; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -47,6 +45,10 @@ import mage.players.Player; import mage.target.TargetSpell; import mage.target.common.TargetCardInHand; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author BetaSteward @@ -96,7 +98,7 @@ class CounterlashEffect extends OneShotEffect { game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); if (player.chooseUse(Outcome.PutCardInPlay, "Cast a nonland card in your hand that shares a card type with that spell without paying its mana cost?", source, game)) { FilterCard filter = new FilterCard(); - ArrayList> types = new ArrayList<>(); + List> types = new ArrayList<>(); for (CardType type: stackObject.getCardType()) { if (type != CardType.LAND) { types.add(new CardTypePredicate(type)); diff --git a/Mage.Sets/src/mage/cards/c/CracklingDoom.java b/Mage.Sets/src/mage/cards/c/CracklingDoom.java index 4642bf780b..2b0f5b8187 100644 --- a/Mage.Sets/src/mage/cards/c/CracklingDoom.java +++ b/Mage.Sets/src/mage/cards/c/CracklingDoom.java @@ -27,8 +27,6 @@ */ package mage.cards.c; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamagePlayersEffect; @@ -47,6 +45,10 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -92,7 +94,7 @@ class CracklingDoomEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - ArrayList toSacrifice = new ArrayList<>(); + List toSacrifice = new ArrayList<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { if (controller.hasOpponent(playerId, game)) { Player opponent = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/cards/c/CryptOfTheEternals.java b/Mage.Sets/src/mage/cards/c/CryptOfTheEternals.java index 649261c106..ffd18b00e5 100644 --- a/Mage.Sets/src/mage/cards/c/CryptOfTheEternals.java +++ b/Mage.Sets/src/mage/cards/c/CryptOfTheEternals.java @@ -1,7 +1,5 @@ package mage.cards.c; -import java.util.ArrayList; -import java.util.UUID; import mage.Mana; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; @@ -14,6 +12,10 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + public class CryptOfTheEternals extends CardImpl { public CryptOfTheEternals(UUID ownerId, CardSetInfo setInfo) { @@ -26,7 +28,7 @@ public class CryptOfTheEternals extends CardImpl { this.addAbility(new ColorlessManaAbility()); // {1}, {T}: Add {U}, {B}, or {R} to your mana pool. - ArrayList list = new ArrayList() {{ + List list = new ArrayList() {{ add(Mana.BlueMana(1)); add(Mana.BlackMana(1)); add(Mana.RedMana(1)); diff --git a/Mage.Sets/src/mage/cards/c/CrypticGateway.java b/Mage.Sets/src/mage/cards/c/CrypticGateway.java index 475caa9114..8c17e28e5d 100644 --- a/Mage.Sets/src/mage/cards/c/CrypticGateway.java +++ b/Mage.Sets/src/mage/cards/c/CrypticGateway.java @@ -27,9 +27,6 @@ */ package mage.cards.c; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.Cost; @@ -55,6 +52,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledPermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author spjspj @@ -199,7 +200,7 @@ class CrypticGatewayEffect extends OneShotEffect { changeling2 = true; } - ArrayList subtypes = new ArrayList<>(); + List subtypes = new ArrayList<>(); for (SubType subtype : creature.getSubtype(game)) { if (creature2.getSubtype(game).contains(subtype) || changeling2) { diff --git a/Mage.Sets/src/mage/cards/c/CustodiSquire.java b/Mage.Sets/src/mage/cards/c/CustodiSquire.java index 6e8df4337a..ef9e3e6252 100644 --- a/Mage.Sets/src/mage/cards/c/CustodiSquire.java +++ b/Mage.Sets/src/mage/cards/c/CustodiSquire.java @@ -27,8 +27,6 @@ */ package mage.cards.c; -import java.util.HashMap; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -45,6 +43,10 @@ import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author LevelX2 @@ -105,7 +107,7 @@ class CustodiSquireVoteEffect extends OneShotEffect { Cards possibleCards = new CardsImpl(); possibleCards.addAll(controller.getGraveyard().getCards(filter, game)); if (!possibleCards.isEmpty()) { - HashMap cardCounter = new HashMap<>(); + Map cardCounter = new HashMap<>(); TargetCard target = new TargetCard(1, 1, Zone.GRAVEYARD, filter); int maxCount = 1; for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { diff --git a/Mage.Sets/src/mage/cards/d/DeadlyTempest.java b/Mage.Sets/src/mage/cards/d/DeadlyTempest.java index 2ebdd3028f..c7ee54d48c 100644 --- a/Mage.Sets/src/mage/cards/d/DeadlyTempest.java +++ b/Mage.Sets/src/mage/cards/d/DeadlyTempest.java @@ -27,8 +27,6 @@ */ package mage.cards.d; -import java.util.HashMap; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -40,6 +38,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author LevelX2 @@ -83,15 +85,15 @@ class DeadlyTempestEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - HashMap destroyedCreatures = new HashMap<>(); + Map destroyedCreatures = new HashMap<>(); for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (permanent.destroy(source.getSourceId(), game, false)) { - int count = destroyedCreatures.containsKey(permanent.getControllerId()) ? destroyedCreatures.get(permanent.getControllerId()) : 0; + int count = destroyedCreatures.getOrDefault(permanent.getControllerId(), 0); destroyedCreatures.put(permanent.getControllerId(), count + 1); } } for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { - int count = destroyedCreatures.containsKey(playerId) ? destroyedCreatures.get(playerId) : 0; + int count = destroyedCreatures.getOrDefault(playerId, 0); if (count > 0) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java b/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java index 4367a6a7b0..da4c02d0cd 100644 --- a/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java +++ b/Mage.Sets/src/mage/cards/d/DescentOfTheDragons.java @@ -27,8 +27,6 @@ */ package mage.cards.d; -import java.util.HashMap; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -42,6 +40,10 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * @author jeffwadsworth */ @@ -86,7 +88,7 @@ class DescentOfTheDragonsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - HashMap playersWithTargets = new HashMap<>(); + Map playersWithTargets = new HashMap<>(); for (Target target : source.getTargets()) { for (UUID permanentId : target.getTargets()) { Permanent permanent = game.getPermanent(permanentId); diff --git a/Mage.Sets/src/mage/cards/d/DroidFactory.java b/Mage.Sets/src/mage/cards/d/DroidFactory.java index 3078de3ca5..e24e4ab60b 100644 --- a/Mage.Sets/src/mage/cards/d/DroidFactory.java +++ b/Mage.Sets/src/mage/cards/d/DroidFactory.java @@ -27,8 +27,6 @@ */ package mage.cards.d; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.common.SacrificeSourceCost; @@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Styxo @@ -84,7 +86,7 @@ public class DroidFactory extends CardImpl { addCost(new SacrificeSourceCost()); FilterCard filter = new FilterCard("basic Plains, Island or Swamp"); filter.add(new CardTypePredicate(CardType.LAND)); - ArrayList> subtypePredicates = new ArrayList<>(); + List> subtypePredicates = new ArrayList<>(); subtypePredicates.add(new SubtypePredicate(SubType.SWAMP)); subtypePredicates.add(new SubtypePredicate(SubType.PLAINS)); subtypePredicates.add(new SubtypePredicate(SubType.ISLAND)); diff --git a/Mage.Sets/src/mage/cards/d/DwarvenArmorer.java b/Mage.Sets/src/mage/cards/d/DwarvenArmorer.java index e0080af813..2fe3a19de7 100644 --- a/Mage.Sets/src/mage/cards/d/DwarvenArmorer.java +++ b/Mage.Sets/src/mage/cards/d/DwarvenArmorer.java @@ -27,8 +27,6 @@ */ package mage.cards.d; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -52,6 +50,10 @@ import mage.players.Player; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LoneFox @@ -84,7 +86,7 @@ public class DwarvenArmorer extends CardImpl { class DwarvenArmorerEffect extends OneShotEffect { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add("+0/+1"); diff --git a/Mage.Sets/src/mage/cards/e/EmptyShrineKannushi.java b/Mage.Sets/src/mage/cards/e/EmptyShrineKannushi.java index 22927ff883..5c76c4c55b 100644 --- a/Mage.Sets/src/mage/cards/e/EmptyShrineKannushi.java +++ b/Mage.Sets/src/mage/cards/e/EmptyShrineKannushi.java @@ -27,8 +27,6 @@ */ package mage.cards.e; -import java.util.ArrayList; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.ObjectColor; @@ -45,6 +43,10 @@ import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -113,7 +115,7 @@ class EmptyShrineKannushiProtectionAbility extends ProtectionAbility { } } - ArrayList> colorPredicates = new ArrayList<>(); + List> colorPredicates = new ArrayList<>(); if (color.isBlack()) { colorPredicates.add(new ColorPredicate(ObjectColor.BLACK)); } diff --git a/Mage.Sets/src/mage/cards/e/EndHostilities.java b/Mage.Sets/src/mage/cards/e/EndHostilities.java index 2f21308aca..e3ec1656e4 100644 --- a/Mage.Sets/src/mage/cards/e/EndHostilities.java +++ b/Mage.Sets/src/mage/cards/e/EndHostilities.java @@ -27,8 +27,6 @@ */ package mage.cards.e; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -39,6 +37,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -83,7 +85,7 @@ class EndHostilitiesEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - ArrayList toDestroy = new ArrayList<>(); + List toDestroy = new ArrayList<>(); for (Permanent permanent : game.getBattlefield().getActivePermanents(controller.getId(), game)) { if (permanent.isCreature()) { toDestroy.add(permanent); diff --git a/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java b/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java index a44bf45d04..0f7112442b 100644 --- a/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java +++ b/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java @@ -27,8 +27,6 @@ */ package mage.cards.e; -import java.util.HashMap; -import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.keyword.InvestigateEffect; @@ -43,6 +41,10 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.watchers.Watcher; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * @author LevelX2 */ @@ -106,7 +108,7 @@ class ErdwalIlluminatorTriggeredAbility extends TriggeredAbilityImpl { class InvestigatedWatcher extends Watcher { - private final HashMap timesInvestigated = new HashMap<>(); + private final Map timesInvestigated = new HashMap<>(); public InvestigatedWatcher() { super(InvestigatedWatcher.class.getSimpleName(), WatcherScope.GAME); diff --git a/Mage.Sets/src/mage/cards/e/EyeOfSingularity.java b/Mage.Sets/src/mage/cards/e/EyeOfSingularity.java index 18fae6cbd0..229c7ae338 100644 --- a/Mage.Sets/src/mage/cards/e/EyeOfSingularity.java +++ b/Mage.Sets/src/mage/cards/e/EyeOfSingularity.java @@ -27,9 +27,6 @@ */ package mage.cards.e; -import java.util.HashMap; -import java.util.Objects; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -49,6 +46,11 @@ import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + /** * * @author spjspj @@ -101,8 +103,8 @@ class EyeOfSingularityETBEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - HashMap cardNames = new HashMap<>(); - HashMap toDestroy = new HashMap<>(); + Map cardNames = new HashMap<>(); + Map toDestroy = new HashMap<>(); for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { String cardName = permanent.getName(); @@ -183,7 +185,7 @@ class EyeOfSingularityTriggeredEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - HashMap toDestroy = new HashMap<>(); + Map toDestroy = new HashMap<>(); Permanent etbPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (etbPermanent == null) { diff --git a/Mage.Sets/src/mage/cards/f/FaithsReward.java b/Mage.Sets/src/mage/cards/f/FaithsReward.java index f0015b4a7f..fb41364683 100644 --- a/Mage.Sets/src/mage/cards/f/FaithsReward.java +++ b/Mage.Sets/src/mage/cards/f/FaithsReward.java @@ -27,8 +27,6 @@ */ package mage.cards.f; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; @@ -43,6 +41,10 @@ import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.watchers.Watcher; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Loki @@ -101,7 +103,7 @@ class FaithsRewardEffect extends OneShotEffect { } class FaithsRewardWatcher extends Watcher { - ArrayList cards = new ArrayList<>(); + List cards = new ArrayList<>(); public FaithsRewardWatcher() { super(FaithsRewardWatcher.class.getSimpleName(), WatcherScope.GAME); diff --git a/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java b/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java index d249cf5964..cd3d3c3307 100644 --- a/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java +++ b/Mage.Sets/src/mage/cards/f/FalkenrathGorger.java @@ -27,8 +27,6 @@ */ package mage.cards.f; -import java.util.HashMap; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -43,6 +41,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author LevelX2 @@ -90,7 +92,7 @@ class FalkenrathGorgerEffect extends ContinuousEffectImpl { } - HashMap madnessAbilities = new HashMap<>(); // reuse the same ability for the same object + Map madnessAbilities = new HashMap<>(); // reuse the same ability for the same object public FalkenrathGorgerEffect() { super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); @@ -111,7 +113,7 @@ class FalkenrathGorgerEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - HashMap usedMadnessAbilities = new HashMap<>(); + Map usedMadnessAbilities = new HashMap<>(); // hand for (Card card : controller.getHand().getCards(filter, game)) { addMadnessToCard(game, card, usedMadnessAbilities); @@ -136,7 +138,7 @@ class FalkenrathGorgerEffect extends ContinuousEffectImpl { return false; } - private void addMadnessToCard(Game game, Card card, HashMap usedMadnessAbilities) { + private void addMadnessToCard(Game game, Card card, Map usedMadnessAbilities) { MadnessAbility ability = madnessAbilities.get(card.getId()); if (ability == null) { ability = new MadnessAbility(card, card.getSpellAbility().getManaCosts()); diff --git a/Mage.Sets/src/mage/cards/f/Fatespinner.java b/Mage.Sets/src/mage/cards/f/Fatespinner.java index ae7794fb38..e14082372b 100644 --- a/Mage.Sets/src/mage/cards/f/Fatespinner.java +++ b/Mage.Sets/src/mage/cards/f/Fatespinner.java @@ -27,8 +27,6 @@ */ package mage.cards.f; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -44,6 +42,10 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LoneFox @@ -74,7 +76,7 @@ public class Fatespinner extends CardImpl { class FatespinnerChooseEffect extends OneShotEffect { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add("Draw step"); diff --git a/Mage.Sets/src/mage/cards/f/FiveAlarmFire.java b/Mage.Sets/src/mage/cards/f/FiveAlarmFire.java index 9340a64f30..e78f9ce457 100644 --- a/Mage.Sets/src/mage/cards/f/FiveAlarmFire.java +++ b/Mage.Sets/src/mage/cards/f/FiveAlarmFire.java @@ -27,8 +27,6 @@ */ package mage.cards.f; -import java.util.HashSet; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; @@ -48,6 +46,10 @@ import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreatureOrPlayer; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Plopman @@ -82,7 +84,7 @@ class FiveAlarmFireTriggeredAbility extends TriggeredAbilityImpl { // Because a creature that is blocked by multiple creatures it deals damage to, only causes to add one counter to , // it's neccessary to remember which creature already triggered - HashSet triggeringCreatures = new HashSet<>(); + Set triggeringCreatures = new HashSet<>(); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); diff --git a/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java b/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java index 69507915ee..0d80865b79 100644 --- a/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java +++ b/Mage.Sets/src/mage/cards/f/FlowstoneSculpture.java @@ -27,8 +27,6 @@ */ package mage.cards.f; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -52,6 +50,10 @@ import mage.counters.CounterType; import mage.game.Game; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LoneFox @@ -82,7 +84,7 @@ public class FlowstoneSculpture extends CardImpl { class FlowstoneSculptureEffect extends OneShotEffect { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add("+1/+1 counter"); diff --git a/Mage.Sets/src/mage/cards/f/ForgottenAncient.java b/Mage.Sets/src/mage/cards/f/ForgottenAncient.java index 7513d62d57..e8fd0ea974 100644 --- a/Mage.Sets/src/mage/cards/f/ForgottenAncient.java +++ b/Mage.Sets/src/mage/cards/f/ForgottenAncient.java @@ -27,8 +27,6 @@ */ package mage.cards.f; -import java.util.ArrayList; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -51,6 +49,10 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Blinke @@ -116,7 +118,7 @@ public class ForgottenAncient extends CardImpl { } int numCounters = sourcePermanent.getCounters(game).getCount(CounterType.P1P1); - ArrayList counterMovements = new ArrayList<>(); + List counterMovements = new ArrayList<>(); do { Target target = new TargetCreaturePermanent(1, 1, filter, true); diff --git a/Mage.Sets/src/mage/cards/g/GazeOfTheGorgon.java b/Mage.Sets/src/mage/cards/g/GazeOfTheGorgon.java index 574af0a47a..201d44b02b 100644 --- a/Mage.Sets/src/mage/cards/g/GazeOfTheGorgon.java +++ b/Mage.Sets/src/mage/cards/g/GazeOfTheGorgon.java @@ -27,8 +27,6 @@ */ package mage.cards.g; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -45,6 +43,10 @@ import mage.players.Player; import mage.target.common.TargetCreaturePermanent; import mage.watchers.common.BlockedAttackerWatcher; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -96,7 +98,7 @@ class GazeOfTheGorgonEffect extends OneShotEffect { if (controller != null && targetCreature != null) { BlockedAttackerWatcher watcher = (BlockedAttackerWatcher) game.getState().getWatchers().get(BlockedAttackerWatcher.class.getSimpleName()); if (watcher != null) { - ArrayList toDestroy = new ArrayList<>(); + List toDestroy = new ArrayList<>(); for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (!creature.getId().equals(targetCreature.getId())) { if (watcher.creatureHasBlockedAttacker(creature, targetCreature, game) || watcher.creatureHasBlockedAttacker(targetCreature, creature, game)) { diff --git a/Mage.Sets/src/mage/cards/g/GhastlyConscription.java b/Mage.Sets/src/mage/cards/g/GhastlyConscription.java index 7db5f35867..cb18627fe3 100644 --- a/Mage.Sets/src/mage/cards/g/GhastlyConscription.java +++ b/Mage.Sets/src/mage/cards/g/GhastlyConscription.java @@ -27,7 +27,6 @@ */ package mage.cards.g; -import java.util.*; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCosts; @@ -47,6 +46,8 @@ import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; +import java.util.*; + /** * * @author LevelX2 @@ -92,7 +93,7 @@ class GhastlyConscriptionEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (controller != null && targetPlayer != null) { - ArrayList cardsToManifest = new ArrayList<>(); + List cardsToManifest = new ArrayList<>(); for (Card card : targetPlayer.getGraveyard().getCards(new FilterCreatureCard(), game)) { cardsToManifest.add(card); controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); diff --git a/Mage.Sets/src/mage/cards/h/HarmonicConvergence.java b/Mage.Sets/src/mage/cards/h/HarmonicConvergence.java index d62687d836..a88d888181 100644 --- a/Mage.Sets/src/mage/cards/h/HarmonicConvergence.java +++ b/Mage.Sets/src/mage/cards/h/HarmonicConvergence.java @@ -42,10 +42,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetCard; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; /** * @@ -94,7 +91,7 @@ class HarmonicConvergenceEffect extends OneShotEffect { source.getSourceId(), game); - HashMap> moveList = new HashMap<>(); + Map> moveList = new HashMap<>(); for (Permanent permanent : enchantments) { List list = moveList.computeIfAbsent(permanent.getControllerId(), k -> new ArrayList<>()); list.add(permanent); diff --git a/Mage.Sets/src/mage/cards/h/HedonistsTrove.java b/Mage.Sets/src/mage/cards/h/HedonistsTrove.java index 0be70c68bb..a024d4458a 100644 --- a/Mage.Sets/src/mage/cards/h/HedonistsTrove.java +++ b/Mage.Sets/src/mage/cards/h/HedonistsTrove.java @@ -27,8 +27,6 @@ */ package mage.cards.h; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -38,17 +36,17 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AsThoughEffectType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.game.ExileZone; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetOpponent; import mage.util.CardUtil; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -100,7 +98,7 @@ class HedonistsTroveExileEffect extends OneShotEffect { MageObject sourceObject = source.getSourceObject(game); if (controller != null && targetPlayer != null && sourceObject != null) { UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); - ArrayList graveyard = new ArrayList<>(targetPlayer.getGraveyard()); + List graveyard = new ArrayList<>(targetPlayer.getGraveyard()); for (UUID cardId : graveyard) { Card card = game.getCard(cardId); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java b/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java index cbbf3d8092..733e4d19c4 100644 --- a/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java +++ b/Mage.Sets/src/mage/cards/i/IndomitableCreativity.java @@ -27,19 +27,11 @@ */ package mage.cards.i; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Set; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; @@ -52,6 +44,8 @@ import mage.players.Library; import mage.players.Player; import mage.target.TargetPermanent; +import java.util.*; + /** * * @author LevelX2 @@ -112,7 +106,7 @@ class IndomitableCreativityEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { - ArrayList destroyedPermanents = new ArrayList<>(); + List destroyedPermanents = new ArrayList<>(); for (UUID targetId : getTargetPointer().getTargets(game, source)) { Permanent target = game.getPermanent(targetId); if (target != null) { @@ -121,7 +115,7 @@ class IndomitableCreativityEffect extends OneShotEffect { } } } - HashMap cardsToReveal = new HashMap<>(); + Map cardsToReveal = new HashMap<>(); for (Permanent permanent : destroyedPermanents) { Player controllerOfDestroyedCreature = game.getPlayer(permanent.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/j/JediEnclave.java b/Mage.Sets/src/mage/cards/j/JediEnclave.java index d14aeee4e4..3d8de85f88 100644 --- a/Mage.Sets/src/mage/cards/j/JediEnclave.java +++ b/Mage.Sets/src/mage/cards/j/JediEnclave.java @@ -27,8 +27,6 @@ */ package mage.cards.j; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.common.SacrificeSourceCost; @@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Styxo @@ -84,7 +86,7 @@ public class JediEnclave extends CardImpl { addCost(new SacrificeSourceCost()); FilterCard filter = new FilterCard("basic Forest, Plains or Island"); filter.add(new CardTypePredicate(CardType.LAND)); - ArrayList> subtypePredicates = new ArrayList<>(); + List> subtypePredicates = new ArrayList<>(); subtypePredicates.add(new SubtypePredicate(SubType.FOREST)); subtypePredicates.add(new SubtypePredicate(SubType.PLAINS)); subtypePredicates.add(new SubtypePredicate(SubType.ISLAND)); diff --git a/Mage.Sets/src/mage/cards/j/JodahsAvenger.java b/Mage.Sets/src/mage/cards/j/JodahsAvenger.java index 688c4132a6..f8aa0ac350 100644 --- a/Mage.Sets/src/mage/cards/j/JodahsAvenger.java +++ b/Mage.Sets/src/mage/cards/j/JodahsAvenger.java @@ -27,8 +27,6 @@ */ package mage.cards.j; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -44,16 +42,15 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; import mage.choices.ChoiceImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Styxo @@ -83,7 +80,7 @@ public class JodahsAvenger extends CardImpl { class JodahsAvengerEffect extends ContinuousEffectImpl { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); private Ability gainedAbility; static { diff --git a/Mage.Sets/src/mage/cards/j/JungleVillage.java b/Mage.Sets/src/mage/cards/j/JungleVillage.java index ef0485f797..de3d303fc0 100644 --- a/Mage.Sets/src/mage/cards/j/JungleVillage.java +++ b/Mage.Sets/src/mage/cards/j/JungleVillage.java @@ -27,8 +27,6 @@ */ package mage.cards.j; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.common.SacrificeSourceCost; @@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Styxo @@ -84,7 +86,7 @@ public class JungleVillage extends CardImpl { addCost(new SacrificeSourceCost()); FilterCard filter = new FilterCard("basic Mountain, Forest or Plains"); filter.add(new CardTypePredicate(CardType.LAND)); - ArrayList> subtypePredicates = new ArrayList<>(); + List> subtypePredicates = new ArrayList<>(); subtypePredicates.add(new SubtypePredicate(SubType.PLAINS)); subtypePredicates.add(new SubtypePredicate(SubType.MOUNTAIN)); subtypePredicates.add(new SubtypePredicate(SubType.FAERIE)); diff --git a/Mage.Sets/src/mage/cards/k/KillingWave.java b/Mage.Sets/src/mage/cards/k/KillingWave.java index b5518f9d6e..5624f39f0c 100644 --- a/Mage.Sets/src/mage/cards/k/KillingWave.java +++ b/Mage.Sets/src/mage/cards/k/KillingWave.java @@ -27,10 +27,6 @@ */ package mage.cards.k; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.OneShotEffect; @@ -43,6 +39,8 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.*; + /** * * @author North @@ -92,8 +90,8 @@ class KillingWaveEffect extends OneShotEffect { int amount = (new ManacostVariableValue()).calculate(game, source, this); if (amount > 0) { - LinkedList sacrifices = new LinkedList<>(); - HashMap lifePaidAmounts = new HashMap<>(); + List sacrifices = new LinkedList<>(); + Map lifePaidAmounts = new HashMap<>(); FilterCreaturePermanent filter = new FilterCreaturePermanent(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { diff --git a/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java b/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java index 7bc07d7616..08e51eed35 100644 --- a/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java +++ b/Mage.Sets/src/mage/cards/k/KynaiosAndTiroOfMeletis.java @@ -27,9 +27,6 @@ */ package mage.cards.k; -import java.util.ArrayList; -import java.util.Objects; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; @@ -46,6 +43,11 @@ import mage.players.PlayerList; import mage.target.Target; import mage.target.common.TargetCardInHand; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.UUID; + /** * @author spjspj */ @@ -104,7 +106,7 @@ class KynaiosAndTirosEffect extends OneShotEffect { Player currentPlayer = game.getPlayer(playerList.get()); UUID firstInactivePlayer = null; Target target = new TargetCardInHand(filter); - ArrayList noLandPlayers = new ArrayList<>(); + List noLandPlayers = new ArrayList<>(); while (controller.canRespond()) { if (currentPlayer != null && currentPlayer.canRespond() && game.getState().getPlayersInRange(controller.getId(), game).contains(currentPlayer.getId())) { diff --git a/Mage.Sets/src/mage/cards/l/LunarAvenger.java b/Mage.Sets/src/mage/cards/l/LunarAvenger.java index 232b503747..898c98f150 100644 --- a/Mage.Sets/src/mage/cards/l/LunarAvenger.java +++ b/Mage.Sets/src/mage/cards/l/LunarAvenger.java @@ -27,8 +27,6 @@ */ package mage.cards.l; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -51,6 +49,10 @@ import mage.counters.CounterType; import mage.game.Game; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LoneFox @@ -82,7 +84,7 @@ public class LunarAvenger extends CardImpl { class LunarAvengerEffect extends OneShotEffect { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add("Flying"); diff --git a/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java b/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java index 3838f98de7..d609df426f 100644 --- a/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java +++ b/Mage.Sets/src/mage/cards/m/MaintenanceDroid.java @@ -27,8 +27,6 @@ */ package mage.cards.m; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -51,6 +49,10 @@ import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Styxo @@ -90,7 +92,7 @@ public class MaintenanceDroid extends CardImpl { class MaintenanceDroidEffect extends OneShotEffect { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add("Remove a repair counter"); diff --git a/Mage.Sets/src/mage/cards/m/MarchOfSouls.java b/Mage.Sets/src/mage/cards/m/MarchOfSouls.java index 95a5389873..85c5f0b922 100644 --- a/Mage.Sets/src/mage/cards/m/MarchOfSouls.java +++ b/Mage.Sets/src/mage/cards/m/MarchOfSouls.java @@ -27,9 +27,6 @@ */ package mage.cards.m; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -41,6 +38,11 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SpiritWhiteToken; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + /** * * @author LoneFox @@ -85,7 +87,7 @@ class MarchOfSoulsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { List creatures = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURES, source.getControllerId(), source.getSourceId(), game); - HashMap playersWithCreatures = new HashMap<>(); + Map playersWithCreatures = new HashMap<>(); for(Permanent p : creatures) { UUID controllerId = p.getControllerId(); if(p.destroy(source.getSourceId(), game, true)) { diff --git a/Mage.Sets/src/mage/cards/m/MartyrsBond.java b/Mage.Sets/src/mage/cards/m/MartyrsBond.java index 0e59377abd..a453d4c548 100644 --- a/Mage.Sets/src/mage/cards/m/MartyrsBond.java +++ b/Mage.Sets/src/mage/cards/m/MartyrsBond.java @@ -27,9 +27,6 @@ */ package mage.cards.m; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -51,6 +48,10 @@ import mage.players.Player; import mage.target.common.TargetControlledPermanent; import mage.target.targetpointer.FixedTarget; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author spjspj @@ -143,7 +144,7 @@ class MartyrsBondEffect extends OneShotEffect { String message = "permanent with type ("; boolean firstType = true; - ArrayList cardTypes = new ArrayList<>(); + List cardTypes = new ArrayList<>(); for (CardType type : saccedPermanent.getCardType()) { cardTypes.add(new CardTypePredicate(type)); diff --git a/Mage.Sets/src/mage/cards/m/MenacingOgre.java b/Mage.Sets/src/mage/cards/m/MenacingOgre.java index 8e35302ace..8b87182ea8 100644 --- a/Mage.Sets/src/mage/cards/m/MenacingOgre.java +++ b/Mage.Sets/src/mage/cards/m/MenacingOgre.java @@ -27,8 +27,6 @@ */ package mage.cards.m; -import java.util.HashMap; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -44,6 +42,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -100,7 +102,7 @@ class MenacingOgreEffect extends OneShotEffect { int number = 0; Permanent menacingOgre = game.getPermanent(source.getSourceId()); String message = "Choose a number."; - HashMap numberChosen = new HashMap<>(); + Map numberChosen = new HashMap<>(); //players choose numbers for (Player player : game.getPlayers().values()) { diff --git a/Mage.Sets/src/mage/cards/m/Mindblaze.java b/Mage.Sets/src/mage/cards/m/Mindblaze.java index 6bb549849b..4745590f11 100644 --- a/Mage.Sets/src/mage/cards/m/Mindblaze.java +++ b/Mage.Sets/src/mage/cards/m/Mindblaze.java @@ -27,8 +27,6 @@ */ package mage.cards.m; -import java.util.HashSet; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -46,6 +44,10 @@ import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Loki @@ -95,7 +97,7 @@ class MindblazeEffect extends OneShotEffect { cardChoice.clearChoice(); Choice numberChoice = new ChoiceImpl(); numberChoice.setMessage("Choose a number greater than 0"); - HashSet numbers = new HashSet<>(); + Set numbers = new HashSet<>(); for (int i = 1; i <= 4; i++) { numbers.add(Integer.toString(i)); } diff --git a/Mage.Sets/src/mage/cards/m/MitoticManipulation.java b/Mage.Sets/src/mage/cards/m/MitoticManipulation.java index f22f373c82..350ea417fc 100644 --- a/Mage.Sets/src/mage/cards/m/MitoticManipulation.java +++ b/Mage.Sets/src/mage/cards/m/MitoticManipulation.java @@ -27,9 +27,6 @@ */ package mage.cards.m; -import java.util.HashSet; -import java.util.List; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.*; @@ -43,6 +40,11 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetCard; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; + /** * * @author North @@ -85,7 +87,7 @@ class MitoticManipulationEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { List permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game); - HashSet permanentNames = new HashSet<>(); + Set permanentNames = new HashSet<>(); FilterCard filter = new FilterCard("card to put onto the battlefield"); for (Permanent permanent : permanents) { permanentNames.add(permanent.getName()); diff --git a/Mage.Sets/src/mage/cards/m/MultiformWonder.java b/Mage.Sets/src/mage/cards/m/MultiformWonder.java index 0dfc1af1f1..565a14d7cf 100644 --- a/Mage.Sets/src/mage/cards/m/MultiformWonder.java +++ b/Mage.Sets/src/mage/cards/m/MultiformWonder.java @@ -27,8 +27,6 @@ */ package mage.cards.m; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -46,16 +44,15 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; import mage.choices.ChoiceImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LevelX2 @@ -90,7 +87,7 @@ public class MultiformWonder extends CardImpl { class MultiformWonderEffect extends OneShotEffect { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add("Flying"); diff --git a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java index f7145aea87..028bb54964 100644 --- a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java +++ b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java @@ -27,19 +27,13 @@ */ package mage.cards.n; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileSpellEffect; import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; @@ -56,6 +50,10 @@ import mage.target.Target; import mage.target.common.TargetCardInGraveyard; import mage.target.targetpointer.FixedTarget; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -110,7 +108,7 @@ class NecromanticSelectionEffect extends OneShotEffect { } } FilterCard filter = new FilterCreatureCard("creature card put into a graveyard with " + sourceObject.getLogName()); - ArrayList> cardIdPredicates = new ArrayList<>(); + List> cardIdPredicates = new ArrayList<>(); for (UUID cardId : cards) { cardIdPredicates.add(new CardIdPredicate(cardId)); } diff --git a/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java b/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java index 376063b826..8d66444e48 100644 --- a/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java +++ b/Mage.Sets/src/mage/cards/n/NicolBolasGodPharaoh.java @@ -27,8 +27,6 @@ */ package mage.cards.n; -import java.util.HashMap; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; @@ -38,17 +36,8 @@ import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.ExileAllEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.AsThoughEffectType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.cards.*; +import mage.constants.*; import mage.filter.FilterCard; import mage.filter.FilterPermanent; import mage.filter.common.FilterNonlandPermanent; @@ -62,6 +51,10 @@ import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetOpponent; import mage.target.targetpointer.FixedTarget; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author Will @@ -126,7 +119,7 @@ class NicolBolasGodPharaohPlusOneEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { // Store for each player the cards to exile, that's important because all exile shall happen at the same time - HashMap cardsToExile = new HashMap<>(); + Map cardsToExile = new HashMap<>(); // Each player chooses 2 cards to discard for (UUID playerId : game.getOpponents(source.getControllerId())) { Player player = game.getPlayer(playerId); diff --git a/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java b/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java index 553cc5bf11..f51889150a 100644 --- a/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java +++ b/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java @@ -27,17 +27,11 @@ */ package mage.cards.n; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.WatcherScope; @@ -48,6 +42,10 @@ import mage.game.events.ZoneChangeEvent; import mage.players.Player; import mage.watchers.Watcher; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author anonymous @@ -115,7 +113,7 @@ class NoRestForTheWickedEffect extends OneShotEffect { class NoRestForTheWickedWatcher extends Watcher { - ArrayList cards; + List cards; public NoRestForTheWickedWatcher() { super(NoRestForTheWickedWatcher.class.getSimpleName(), WatcherScope.GAME); diff --git a/Mage.Sets/src/mage/cards/n/NyleasPresence.java b/Mage.Sets/src/mage/cards/n/NyleasPresence.java index cf1df00d1b..9e02f48aeb 100644 --- a/Mage.Sets/src/mage/cards/n/NyleasPresence.java +++ b/Mage.Sets/src/mage/cards/n/NyleasPresence.java @@ -27,9 +27,6 @@ */ package mage.cards.n; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -38,25 +35,19 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.keyword.EnchantAbility; -import mage.abilities.mana.BasicManaAbility; -import mage.abilities.mana.BlackManaAbility; -import mage.abilities.mana.BlueManaAbility; -import mage.abilities.mana.GreenManaAbility; -import mage.abilities.mana.RedManaAbility; -import mage.abilities.mana.WhiteManaAbility; +import mage.abilities.mana.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -77,7 +68,7 @@ public class NyleasPresence extends CardImpl { // When Nylea's Presence enters the battlefield, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); // Enchanted land is every basic land type in addition to its other types. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NyleasPresenceLandTypeEffect("Swamp", "Mountain", "Forest", "Island", "Plains"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NyleasPresenceLandTypeEffect())); } @@ -93,11 +84,11 @@ public class NyleasPresence extends CardImpl { class NyleasPresenceLandTypeEffect extends ContinuousEffectImpl { - protected ArrayList landTypes = new ArrayList<>(); + protected List landTypes = new ArrayList<>(); - public NyleasPresenceLandTypeEffect(String... landNames) { + public NyleasPresenceLandTypeEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); - landTypes.addAll(Arrays.asList(landNames)); + landTypes.addAll(SubType.getBasicLands(false)); this.staticText = "Enchanted land is every basic land type in addition to its other types"; } @@ -132,24 +123,24 @@ class NyleasPresenceLandTypeEffect extends ContinuousEffectImpl { } } } - if (mana.getGreen() == 0 && landTypes.contains("Forest")) { + if (mana.getGreen() == 0 && landTypes.contains(SubType.FOREST)) { land.addAbility(new GreenManaAbility(), source.getSourceId(), game); } - if (mana.getRed() == 0 && landTypes.contains("Mountain")) { + if (mana.getRed() == 0 && landTypes.contains(SubType.MOUNTAIN)) { land.addAbility(new RedManaAbility(), source.getSourceId(), game); } - if (mana.getBlue() == 0 && landTypes.contains("Island")) { + if (mana.getBlue() == 0 && landTypes.contains(SubType.ISLAND)) { land.addAbility(new BlueManaAbility(), source.getSourceId(), game); } - if (mana.getWhite() == 0 && landTypes.contains("Plains")) { + if (mana.getWhite() == 0 && landTypes.contains(SubType.PLAINS)) { land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); } - if (mana.getBlack() == 0 && landTypes.contains("Swamp")) { + if (mana.getBlack() == 0 && landTypes.contains(SubType.SWAMP)) { land.addAbility(new BlackManaAbility(), source.getSourceId(), game); } break; case TypeChangingEffects_4: - for (String subtype : landTypes) { + for (SubType subtype : landTypes) { if (!land.getSubtype(game).contains(subtype)) { land.getSubtype(game).add(subtype); } diff --git a/Mage.Sets/src/mage/cards/o/OrzhovAdvokist.java b/Mage.Sets/src/mage/cards/o/OrzhovAdvokist.java index 1bd58d36a1..831f9cf3e6 100644 --- a/Mage.Sets/src/mage/cards/o/OrzhovAdvokist.java +++ b/Mage.Sets/src/mage/cards/o/OrzhovAdvokist.java @@ -27,9 +27,6 @@ */ package mage.cards.o; -import java.util.ArrayList; -import java.util.Objects; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -51,6 +48,11 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.UUID; + /** * * @author LevelX2 @@ -100,8 +102,8 @@ class OrzhovAdvokistEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - ArrayList players = new ArrayList<>(); - ArrayList creatures = new ArrayList<>(); + List players = new ArrayList<>(); + List creatures = new ArrayList<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/p/PlanarOverlay.java b/Mage.Sets/src/mage/cards/p/PlanarOverlay.java index e51c8ae44c..33e52bc235 100644 --- a/Mage.Sets/src/mage/cards/p/PlanarOverlay.java +++ b/Mage.Sets/src/mage/cards/p/PlanarOverlay.java @@ -27,9 +27,6 @@ */ package mage.cards.p; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; @@ -44,6 +41,10 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetLandPermanent; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Styxo @@ -91,9 +92,9 @@ class PlanarOverlayEffect extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (String landName : SubType.getBasicLands(false)) { + for (SubType landName : SubType.getBasicLands(false)) { FilterLandPermanent filter = new FilterLandPermanent(landName + " to return to hand"); - filter.add(new SubtypePredicate(SubType.byDescription(landName))); + filter.add(new SubtypePredicate(landName)); filter.add(new ControllerPredicate(TargetController.YOU)); Target target = new TargetLandPermanent(1, 1, filter, true); if (target.canChoose(source.getSourceId(), player.getId(), game)) { diff --git a/Mage.Sets/src/mage/cards/p/PrismaticOmen.java b/Mage.Sets/src/mage/cards/p/PrismaticOmen.java index c89e0f27b3..a3b9fc199c 100644 --- a/Mage.Sets/src/mage/cards/p/PrismaticOmen.java +++ b/Mage.Sets/src/mage/cards/p/PrismaticOmen.java @@ -27,31 +27,22 @@ */ package mage.cards.p; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.mana.BasicManaAbility; -import mage.abilities.mana.BlackManaAbility; -import mage.abilities.mana.BlueManaAbility; -import mage.abilities.mana.GreenManaAbility; -import mage.abilities.mana.RedManaAbility; -import mage.abilities.mana.WhiteManaAbility; +import mage.abilities.mana.*; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -77,11 +68,11 @@ public class PrismaticOmen extends CardImpl { class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl { - protected ArrayList landTypes = new ArrayList<>(); + protected List landTypes = new ArrayList<>(); public BecomesBasicLandTypeAllEffect(String... landNames) { super(Duration.WhileOnBattlefield, Outcome.Detriment); - landTypes.addAll(Arrays.asList(landNames)); + landTypes.addAll(SubType.getBasicLands(false)); this.staticText = "Lands you control are every basic land type in addition to their other types"; } @@ -114,24 +105,24 @@ class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl { } } } - if (mana.getGreen() == 0 && landTypes.contains("Forest")) { + if (mana.getGreen() == 0 && landTypes.contains(SubType.FOREST)) { land.addAbility(new GreenManaAbility(), source.getSourceId(), game); } - if (mana.getRed() == 0 && landTypes.contains("Mountain")) { + if (mana.getRed() == 0 && landTypes.contains(SubType.MOUNTAIN)) { land.addAbility(new RedManaAbility(), source.getSourceId(), game); } - if (mana.getBlue() == 0 && landTypes.contains("Island")) { + if (mana.getBlue() == 0 && landTypes.contains(SubType.ISLAND)) { land.addAbility(new BlueManaAbility(), source.getSourceId(), game); } - if (mana.getWhite() == 0 && landTypes.contains("Plains")) { + if (mana.getWhite() == 0 && landTypes.contains(SubType.PLAINS)) { land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); } - if (mana.getBlack() == 0 && landTypes.contains("Swamp")) { + if (mana.getBlack() == 0 && landTypes.contains(SubType.SWAMP)) { land.addAbility(new BlackManaAbility(), source.getSourceId(), game); } break; case TypeChangingEffects_4: - for (String subtype : landTypes) { + for (SubType subtype : landTypes) { if (!land.getSubtype(game).contains(subtype)) { land.getSubtype(game).add(subtype); } diff --git a/Mage.Sets/src/mage/cards/r/RallyTheAncestors.java b/Mage.Sets/src/mage/cards/r/RallyTheAncestors.java index 2c92b01fbd..e7c777104f 100644 --- a/Mage.Sets/src/mage/cards/r/RallyTheAncestors.java +++ b/Mage.Sets/src/mage/cards/r/RallyTheAncestors.java @@ -27,9 +27,6 @@ */ package mage.cards.r; -import java.util.ArrayList; -import java.util.Set; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility; @@ -51,6 +48,11 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTargets; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; + /** * * @author emerald000 @@ -101,7 +103,7 @@ class RallyTheAncestorsEffect extends OneShotEffect { filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xValue + 1)); Set cards = player.getGraveyard().getCards(filter, game); player.moveCards(cards, Zone.BATTLEFIELD, source, game); - ArrayList toExile = new ArrayList<>(cards.size()); + List toExile = new ArrayList<>(cards.size()); for (Card card : cards) { if (card != null) { Permanent permanent = game.getPermanent(card.getId()); diff --git a/Mage.Sets/src/mage/cards/r/ReapIntellect.java b/Mage.Sets/src/mage/cards/r/ReapIntellect.java index b6f858ca0c..e495fc89f7 100644 --- a/Mage.Sets/src/mage/cards/r/ReapIntellect.java +++ b/Mage.Sets/src/mage/cards/r/ReapIntellect.java @@ -27,17 +27,10 @@ */ package mage.cards.r; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.cards.SplitCard; +import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; @@ -52,6 +45,10 @@ import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetOpponent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -122,7 +119,7 @@ class ReapIntellectEffect extends OneShotEffect { if (!exiledCards.isEmpty()) { // Building a card filter with all names - ArrayList names = new ArrayList<>(); + List names = new ArrayList<>(); FilterCard filterNamedCards = new FilterCard(); for (Card card : exiledCards.getCards(game)) { if (exiledCards.size() == 1) { diff --git a/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java b/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java index 86c6e555bd..636e937c4b 100644 --- a/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java +++ b/Mage.Sets/src/mage/cards/r/ReinsOfTheVinesteed.java @@ -27,8 +27,6 @@ */ package mage.cards.r; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.DiesAttachedTriggeredAbility; @@ -51,6 +49,10 @@ import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -110,7 +112,7 @@ class ReinsOfTheVinesteedEffect extends OneShotEffect { } FilterCreaturePermanent FILTER = new FilterCreaturePermanent(); StringBuilder sb = new StringBuilder("creature that shares a creature type with the formerly attached creature: "); - ArrayList> subtypes = new ArrayList<>(); + List> subtypes = new ArrayList<>(); for (SubType subtype : lastStateCreature.getSubtype(game)) { subtypes.add(new SubtypePredicate(subtype)); sb.append(subtype).append(", "); diff --git a/Mage.Sets/src/mage/cards/r/RestoreBalance.java b/Mage.Sets/src/mage/cards/r/RestoreBalance.java index c9ff150557..8569f78223 100644 --- a/Mage.Sets/src/mage/cards/r/RestoreBalance.java +++ b/Mage.Sets/src/mage/cards/r/RestoreBalance.java @@ -27,17 +27,11 @@ */ package mage.cards.r; -import java.util.HashMap; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.SuspendAbility; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.cards.*; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Outcome; @@ -50,6 +44,10 @@ import mage.players.Player; import mage.target.common.TargetCardInHand; import mage.target.common.TargetControlledPermanent; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author Plopman @@ -168,7 +166,7 @@ class RestoreBalanceEffect extends OneShotEffect { //Cards in hand int minCard = Integer.MAX_VALUE; - HashMap cardsToDiscard = new HashMap<>(2); + Map cardsToDiscard = new HashMap<>(2); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/r/RiteOfRuin.java b/Mage.Sets/src/mage/cards/r/RiteOfRuin.java index c9c587c80d..a2bb5c27eb 100644 --- a/Mage.Sets/src/mage/cards/r/RiteOfRuin.java +++ b/Mage.Sets/src/mage/cards/r/RiteOfRuin.java @@ -27,9 +27,6 @@ */ package mage.cards.r; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -44,6 +41,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledPermanent; +import java.util.*; + /** * * @author North @@ -91,7 +90,7 @@ class RiteOfRuinEffect extends OneShotEffect { return false; } - HashSet choices = new HashSet<>(); + Set choices = new HashSet<>(); choices.add("Artifacts"); choices.add("Creatures"); choices.add("Lands"); @@ -106,7 +105,7 @@ class RiteOfRuinEffect extends OneShotEffect { } order.add(getCardType(choices.iterator().next())); - LinkedList sacrifices = new LinkedList<>(); + List sacrifices = new LinkedList<>(); int count = 1; for (CardType cardType : order) { FilterControlledPermanent filter = new FilterControlledPermanent(cardType + " permanent you control"); diff --git a/Mage.Sets/src/mage/cards/s/SavageSummoning.java b/Mage.Sets/src/mage/cards/s/SavageSummoning.java index 38a715d438..e4bc858538 100644 --- a/Mage.Sets/src/mage/cards/s/SavageSummoning.java +++ b/Mage.Sets/src/mage/cards/s/SavageSummoning.java @@ -27,12 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.CantBeCounteredAbility; @@ -42,11 +36,7 @@ import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AsThoughEffectType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.WatcherScope; +import mage.constants.*; import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Commander; @@ -57,6 +47,9 @@ import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.watchers.Watcher; +import java.util.*; +import java.util.Map.Entry; + /** * * @author LevelX2 @@ -200,7 +193,7 @@ class SavageSummoningWatcher extends Watcher { public boolean isSpellCastWithThisSavageSummoning(UUID spellId, UUID cardId, int zoneChangeCounter) { String cardKey = new StringBuilder(cardId.toString()).append('_').append(zoneChangeCounter).toString(); - HashSet savageSpells = (HashSet) spellsCastWithSavageSummoning.get(spellId); + Set savageSpells = spellsCastWithSavageSummoning.get(spellId); return savageSpells != null && savageSpells.contains(cardKey); } @@ -208,7 +201,7 @@ class SavageSummoningWatcher extends Watcher { String creatureCardKey = card.getId().toString() + '_' + (card.getZoneChangeCounter(game)); // add one because card is now gone to battlefield as creature String cardKey = cardId.toString() + '_' + zoneChangeCounter; - HashSet savageSpells = (HashSet) cardsCastWithSavageSummoning.get(creatureCardKey); + Set savageSpells = cardsCastWithSavageSummoning.get(creatureCardKey); return savageSpells != null && savageSpells.contains(cardKey); } diff --git a/Mage.Sets/src/mage/cards/s/ScytheSpecter.java b/Mage.Sets/src/mage/cards/s/ScytheSpecter.java index 04a9d91a44..8e776201cc 100644 --- a/Mage.Sets/src/mage/cards/s/ScytheSpecter.java +++ b/Mage.Sets/src/mage/cards/s/ScytheSpecter.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.HashMap; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; @@ -46,6 +44,10 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetDiscard; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -90,8 +92,8 @@ class ScytheSpecterEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - HashMap cardDiscarded = new HashMap<>(); - HashMap discardedCheck = new HashMap<>(); + Map cardDiscarded = new HashMap<>(); + Map discardedCheck = new HashMap<>(); Integer highestCMC = 0; Integer currentCMC = 0; Player controller = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/cards/s/SecondSunrise.java b/Mage.Sets/src/mage/cards/s/SecondSunrise.java index 80302d0aae..8940e37f19 100644 --- a/Mage.Sets/src/mage/cards/s/SecondSunrise.java +++ b/Mage.Sets/src/mage/cards/s/SecondSunrise.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; @@ -43,6 +41,10 @@ import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.watchers.Watcher; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -103,7 +105,7 @@ class SecondSunriseEffect extends OneShotEffect { } class SecondSunriseWatcher extends Watcher { - ArrayList cards = new ArrayList<>(); + List cards = new ArrayList<>(); public SecondSunriseWatcher() { super(SecondSunriseWatcher.class.getSimpleName(), WatcherScope.GAME); diff --git a/Mage.Sets/src/mage/cards/s/Shapeshifter.java b/Mage.Sets/src/mage/cards/s/Shapeshifter.java index b803ce72bc..b935c9dae8 100644 --- a/Mage.Sets/src/mage/cards/s/Shapeshifter.java +++ b/Mage.Sets/src/mage/cards/s/Shapeshifter.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -41,18 +39,16 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; import mage.choices.ChoiceImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author MarcoMarin / HCrescent @@ -101,21 +97,21 @@ class ShapeshifterEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player Controller = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); MageObject mageObject = game.getPermanentEntering(source.getSourceId()); if (mageObject == null) { mageObject = game.getPermanent(source.getSourceId()); } - if (Controller != null) { + if (controller != null) { Choice numberChoice = new ChoiceImpl(); numberChoice.setMessage("Choose a number beween 0 and 7"); - HashSet numbers = new HashSet<>(); + Set numbers = new HashSet<>(); for (int i = 0; i <= 7; i++) { numbers.add(Integer.toString(i)); } numberChoice.setChoices(numbers); - while (!Controller.choose(Outcome.Neutral, numberChoice, game)) { - if (!Controller.canRespond()) { + while (!controller.choose(Outcome.Neutral, numberChoice, game)) { + if (!controller.canRespond()) { return false; } } diff --git a/Mage.Sets/src/mage/cards/s/SharedAnimosity.java b/Mage.Sets/src/mage/cards/s/SharedAnimosity.java index 96d0bfb677..fd6b7dc2e6 100644 --- a/Mage.Sets/src/mage/cards/s/SharedAnimosity.java +++ b/Mage.Sets/src/mage/cards/s/SharedAnimosity.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; @@ -47,6 +45,10 @@ import mage.filter.predicate.permanent.PermanentIdPredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Plopman @@ -109,7 +111,7 @@ class SharedAnimosityEffect extends ContinuousEffectImpl { } } if(!allCreatureTypes){ - ArrayList> predicateList = new ArrayList<>(); + List> predicateList = new ArrayList<>(); for(SubType subtype : permanent.getSubtype(game)){ predicateList.add(new SubtypePredicate(subtype)); } diff --git a/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java b/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java index 9d6a3cf974..6ec74cc10a 100644 --- a/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java +++ b/Mage.Sets/src/mage/cards/s/SilenceTheBelievers.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.abilityword.StriveAbility; import mage.abilities.effects.OneShotEffect; @@ -42,6 +40,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** @@ -95,7 +97,7 @@ class SilenceTheBelieversExileEffect extends OneShotEffect { for (UUID targetId: this.getTargetPointer().getTargets(game, source)) { Permanent creature = game.getPermanent(targetId); if (creature != null) { - ArrayList attachments = new ArrayList<>(creature.getAttachments()); + List attachments = new ArrayList<>(creature.getAttachments()); for (UUID attachmentId: attachments) { Permanent attachment = game.getPermanent(attachmentId); if (attachment != null && attachment.getSubtype(game).contains("Aura")) { diff --git a/Mage.Sets/src/mage/cards/s/SithEvoker.java b/Mage.Sets/src/mage/cards/s/SithEvoker.java index 93224d1460..a1e836de18 100644 --- a/Mage.Sets/src/mage/cards/s/SithEvoker.java +++ b/Mage.Sets/src/mage/cards/s/SithEvoker.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -51,6 +49,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Styxo @@ -84,7 +86,7 @@ public class SithEvoker extends CardImpl { class SithEvokerEffect extends OneShotEffect { - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add("Gain life equal to creature's power"); diff --git a/Mage.Sets/src/mage/cards/s/SithRuins.java b/Mage.Sets/src/mage/cards/s/SithRuins.java index 588d0fc082..05be1f30ab 100644 --- a/Mage.Sets/src/mage/cards/s/SithRuins.java +++ b/Mage.Sets/src/mage/cards/s/SithRuins.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.common.SacrificeSourceCost; @@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Styxo @@ -84,7 +86,7 @@ public class SithRuins extends CardImpl { addCost(new SacrificeSourceCost()); FilterCard filter = new FilterCard("basic Island, Swamp or Mountain"); filter.add(new CardTypePredicate(CardType.LAND)); - ArrayList> subtypePredicates = new ArrayList<>(); + List> subtypePredicates = new ArrayList<>(); subtypePredicates.add(new SubtypePredicate(SubType.SWAMP)); subtypePredicates.add(new SubtypePredicate(SubType.MOUNTAIN)); subtypePredicates.add(new SubtypePredicate(SubType.ISLAND)); diff --git a/Mage.Sets/src/mage/cards/s/SoulOfRavnica.java b/Mage.Sets/src/mage/cards/s/SoulOfRavnica.java index e454cf2391..667cf8469d 100644 --- a/Mage.Sets/src/mage/cards/s/SoulOfRavnica.java +++ b/Mage.Sets/src/mage/cards/s/SoulOfRavnica.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -46,6 +44,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LevelX2 @@ -100,7 +102,7 @@ class SoulOfRavnicaEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - HashSet colors = new HashSet<>(); + Set colors = new HashSet<>(); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) { if (permanent.getColor(game).isBlack()) { colors.add(ObjectColor.BLACK); diff --git a/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java b/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java index 7499490528..2432fe360e 100644 --- a/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java +++ b/Mage.Sets/src/mage/cards/s/SpiritOfResistance.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -45,6 +43,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * @author Quercitron */ @@ -79,7 +81,7 @@ enum SpiritOfResistanceCondition implements Condition { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - HashSet colors = new HashSet<>(); + Set colors = new HashSet<>(); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) { if (permanent.getColor(game).isBlack()) { colors.add(ObjectColor.BLACK); diff --git a/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java b/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java index 8f00bfe51f..0929831521 100644 --- a/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java +++ b/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -40,6 +38,10 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.watchers.Watcher; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * @@ -71,7 +73,7 @@ public class SpiritOfTheLabyrinth extends CardImpl { class SpiritOfTheLabyrinthWatcher extends Watcher { - private final HashSet playersThatDrewCard; + private final Set playersThatDrewCard; public SpiritOfTheLabyrinthWatcher() { super(SpiritOfTheLabyrinthWatcher.class.getSimpleName(), WatcherScope.GAME); diff --git a/Mage.Sets/src/mage/cards/s/StorageMatrix.java b/Mage.Sets/src/mage/cards/s/StorageMatrix.java index 74575b5b11..45c40eb7ee 100644 --- a/Mage.Sets/src/mage/cards/s/StorageMatrix.java +++ b/Mage.Sets/src/mage/cards/s/StorageMatrix.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.RestrictionEffect; @@ -44,6 +42,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LevelX2 @@ -71,7 +73,7 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect { private int turn; private boolean applies; - private static final HashSet choice = new HashSet<>(); + private static final Set choice = new HashSet<>(); static { choice.add(CardType.ARTIFACT.toString()); diff --git a/Mage.Sets/src/mage/cards/s/SunderingTitan.java b/Mage.Sets/src/mage/cards/s/SunderingTitan.java index f67ef09620..ac9dc94ff5 100644 --- a/Mage.Sets/src/mage/cards/s/SunderingTitan.java +++ b/Mage.Sets/src/mage/cards/s/SunderingTitan.java @@ -27,9 +27,6 @@ */ package mage.cards.s; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldOrLeavesSourceTriggeredAbility; @@ -47,6 +44,10 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetLandPermanent; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LevelX2 @@ -96,9 +97,9 @@ class SunderingTitanDestroyLandEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); Set lands = new HashSet<>(); if (controller != null && sourcePermanent != null) { - for (String landName : SubType.getBasicLands(false)) { + for (SubType landName : SubType.getBasicLands(false)) { FilterLandPermanent filter = new FilterLandPermanent(landName + " to destroy"); - filter.add(new SubtypePredicate(SubType.byDescription(landName))); + filter.add(new SubtypePredicate(landName)); Target target = new TargetLandPermanent(1, 1, filter, true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { controller.chooseTarget(outcome, target, source, game); diff --git a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java index 5ed5279fd9..aa64e27246 100644 --- a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java +++ b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java @@ -27,9 +27,6 @@ */ package mage.cards.t; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -58,6 +55,10 @@ import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -123,7 +124,7 @@ class TamiyoFieldResearcherEffect1 extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - ArrayList creatures = new ArrayList<>(); + List creatures = new ArrayList<>(); for (UUID uuid : getTargetPointer().getTargets(game, source)) { creatures.add(new MageObjectReference(uuid, game)); } diff --git a/Mage.Sets/src/mage/cards/t/Tarmogoyf.java b/Mage.Sets/src/mage/cards/t/Tarmogoyf.java index ee2be7559f..ed9392855c 100644 --- a/Mage.Sets/src/mage/cards/t/Tarmogoyf.java +++ b/Mage.Sets/src/mage/cards/t/Tarmogoyf.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.HashSet; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -37,15 +35,14 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.players.Player; +import java.util.EnumSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Plopman @@ -95,7 +92,7 @@ class TarmogoyfEffect extends ContinuousEffectImpl { if (controller != null) { MageObject target = game.getObject(source.getSourceId()); if (target != null) { - HashSet foundCardTypes = new HashSet<>(); + Set foundCardTypes = EnumSet.noneOf(CardType.class); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/t/TeferisRealm.java b/Mage.Sets/src/mage/cards/t/TeferisRealm.java index 1e5dcf732b..d74b69fcb1 100644 --- a/Mage.Sets/src/mage/cards/t/TeferisRealm.java +++ b/Mage.Sets/src/mage/cards/t/TeferisRealm.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.HashSet; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -46,6 +44,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author LevelX2 @@ -76,7 +78,7 @@ class TeferisRealmEffect extends OneShotEffect { private static final String CREATURE = "Creature"; private static final String LAND = "Land"; private static final String NON_AURA_ENCHANTMENT = "Non-Aura enchantment"; - private static final HashSet choices = new HashSet<>(); + private static final Set choices = new HashSet<>(); static { choices.add(ARTIFACT); diff --git a/Mage.Sets/src/mage/cards/t/Terastodon.java b/Mage.Sets/src/mage/cards/t/Terastodon.java index c5abdf6bcd..5dc9734eed 100644 --- a/Mage.Sets/src/mage/cards/t/Terastodon.java +++ b/Mage.Sets/src/mage/cards/t/Terastodon.java @@ -27,9 +27,6 @@ */ package mage.cards.t; -import java.util.HashMap; -import java.util.Map.Entry; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -47,6 +44,11 @@ import mage.game.permanent.Permanent; import mage.game.permanent.token.ElephantToken; import mage.target.TargetPermanent; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -100,7 +102,7 @@ class TerastodonEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - HashMap destroyedPermanents = new HashMap<>(); + Map destroyedPermanents = new HashMap<>(); for (UUID targetID : this.targetPointer.getTargets(game, source)) { Permanent permanent = game.getPermanent(targetID); if (permanent != null) { diff --git a/Mage.Sets/src/mage/cards/t/ThatcherRevolt.java b/Mage.Sets/src/mage/cards/t/ThatcherRevolt.java index 416907dea2..39b4fcbdac 100644 --- a/Mage.Sets/src/mage/cards/t/ThatcherRevolt.java +++ b/Mage.Sets/src/mage/cards/t/ThatcherRevolt.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -42,6 +40,10 @@ import mage.game.permanent.Permanent; import mage.game.permanent.token.ThatcherHumanToken; import mage.target.targetpointer.FixedTargets; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author North @@ -85,7 +87,7 @@ class ThatcherRevoltEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { ThatcherHumanToken token = new ThatcherHumanToken(); token.putOntoBattlefield(3, game, source.getSourceId(), source.getControllerId()); - ArrayList toSacrifice = new ArrayList<>(); + List toSacrifice = new ArrayList<>(); for (UUID tokenId : token.getLastAddedTokenIds()) { Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { diff --git a/Mage.Sets/src/mage/cards/t/ThranTurbine.java b/Mage.Sets/src/mage/cards/t/ThranTurbine.java index d3575db080..b2480d4a6d 100644 --- a/Mage.Sets/src/mage/cards/t/ThranTurbine.java +++ b/Mage.Sets/src/mage/cards/t/ThranTurbine.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.HashSet; -import java.util.UUID; import mage.ConditionalMana; import mage.Mana; import mage.abilities.Ability; @@ -52,6 +50,10 @@ import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author spjspjs @@ -97,7 +99,7 @@ class ThranTurbineEffect extends OneShotEffect { if (player != null) { Choice numberChoice = new ChoiceImpl(); - HashSet numbers = new HashSet<>(); + Set numbers = new HashSet<>(); numbers.add(Integer.toString(1)); numbers.add(Integer.toString(2)); numberChoice.setChoices(numbers); diff --git a/Mage.Sets/src/mage/cards/t/Turnabout.java b/Mage.Sets/src/mage/cards/t/Turnabout.java index 45aaa8cc2d..e15011b9e4 100644 --- a/Mage.Sets/src/mage/cards/t/Turnabout.java +++ b/Mage.Sets/src/mage/cards/t/Turnabout.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.HashSet; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -46,6 +44,10 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPlayer; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** * * @author Plopman @@ -73,7 +75,7 @@ public class Turnabout extends CardImpl { class TurnaboutEffect extends OneShotEffect { - private static final HashSet choice = new HashSet<>(); + private static final Set choice = new HashSet<>(); static { choice.add(CardType.ARTIFACT.toString()); @@ -81,7 +83,7 @@ class TurnaboutEffect extends OneShotEffect { choice.add(CardType.LAND.toString()); } - private static final HashSet choice2 = new HashSet<>(); + private static final Set choice2 = new HashSet<>(); static { choice2.add("Untap"); diff --git a/Mage.Sets/src/mage/cards/t/Twinflame.java b/Mage.Sets/src/mage/cards/t/Twinflame.java index 46cb485596..565e9b91b3 100644 --- a/Mage.Sets/src/mage/cards/t/Twinflame.java +++ b/Mage.Sets/src/mage/cards/t/Twinflame.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.abilityword.StriveAbility; @@ -48,6 +46,10 @@ import mage.target.common.TargetControlledCreaturePermanent; import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTargets; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -95,7 +97,7 @@ class TwinflameCopyEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - ArrayList toExile = new ArrayList<>(); + List toExile = new ArrayList<>(); for (UUID creatureId : this.getTargetPointer().getTargets(game, source)) { Permanent creature = game.getPermanentOrLKIBattlefield(creatureId); if (creature != null) { diff --git a/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java b/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java index 015816d825..1ed1d1883d 100644 --- a/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java +++ b/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java @@ -27,10 +27,6 @@ */ package mage.cards.t; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfPostCombatMainTriggeredAbility; @@ -49,6 +45,8 @@ import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.watchers.Watcher; +import java.util.*; + /** * * @author LevelX2 @@ -122,7 +120,7 @@ class TymnaTheWeaverEffect extends OneShotEffect { class TymnaTheWeaverWatcher extends Watcher { // private final Set players = new HashSet<>(); - private final HashMap> players = new HashMap<>(); + private final Map> players = new HashMap<>(); public TymnaTheWeaverWatcher() { super(TymnaTheWeaverWatcher.class.getSimpleName(), WatcherScope.GAME); @@ -131,7 +129,7 @@ class TymnaTheWeaverWatcher extends Watcher { public TymnaTheWeaverWatcher(final TymnaTheWeaverWatcher watcher) { super(watcher); for (UUID playerId : watcher.players.keySet()) { - HashSet opponents = new HashSet<>(); + Set opponents = new HashSet<>(); opponents.addAll(watcher.players.get(playerId)); players.put(playerId, opponents); } diff --git a/Mage.Sets/src/mage/cards/u/UbaMask.java b/Mage.Sets/src/mage/cards/u/UbaMask.java index 32f7a1a173..7581d6bb08 100644 --- a/Mage.Sets/src/mage/cards/u/UbaMask.java +++ b/Mage.Sets/src/mage/cards/u/UbaMask.java @@ -27,10 +27,6 @@ */ package mage.cards.u; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; @@ -40,17 +36,14 @@ import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AsThoughEffectType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.WatcherScope; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; import mage.watchers.Watcher; +import java.util.*; + /** * * @author LevelX2 @@ -162,7 +155,7 @@ class UbaMaskPlayEffect extends AsThoughEffectImpl { class UbaMaskExiledCardsWatcher extends Watcher { - private final HashMap> exiledCards = new HashMap<>(); + private final Map> exiledCards = new HashMap<>(); public UbaMaskExiledCardsWatcher() { super(UbaMaskExiledCardsWatcher.class.getSimpleName(), WatcherScope.GAME); diff --git a/Mage.Sets/src/mage/cards/u/UnderworldSlums.java b/Mage.Sets/src/mage/cards/u/UnderworldSlums.java index 7b2ef7a4b1..1a31ec8e0f 100644 --- a/Mage.Sets/src/mage/cards/u/UnderworldSlums.java +++ b/Mage.Sets/src/mage/cards/u/UnderworldSlums.java @@ -27,8 +27,6 @@ */ package mage.cards.u; -import java.util.ArrayList; -import java.util.UUID; import mage.MageObject; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.common.SacrificeSourceCost; @@ -46,6 +44,10 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author Styxo @@ -84,7 +86,7 @@ public class UnderworldSlums extends CardImpl { addCost(new SacrificeSourceCost()); FilterCard filter = new FilterCard("basic Swamp, Mountain or Forest"); filter.add(new CardTypePredicate(CardType.LAND)); - ArrayList> subtypePredicates = new ArrayList<>(); + List> subtypePredicates = new ArrayList<>(); subtypePredicates.add(new SubtypePredicate(SubType.SWAMP)); subtypePredicates.add(new SubtypePredicate(SubType.MOUNTAIN)); subtypePredicates.add(new SubtypePredicate(SubType.FOREST)); diff --git a/Mage.Sets/src/mage/cards/u/UrzasMiter.java b/Mage.Sets/src/mage/cards/u/UrzasMiter.java index 2a80ece079..17e5068e76 100644 --- a/Mage.Sets/src/mage/cards/u/UrzasMiter.java +++ b/Mage.Sets/src/mage/cards/u/UrzasMiter.java @@ -27,8 +27,6 @@ */ package mage.cards.u; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.ZoneChangeAllTriggeredAbility; import mage.abilities.costs.Cost; @@ -46,6 +44,10 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.watchers.Watcher; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author MarcoMarin @@ -95,7 +97,7 @@ class UrzasMiterDoIfCostPaid extends DoIfCostPaid { class UrzasMiterWatcher extends Watcher { - ArrayList cards; + List cards; public UrzasMiterWatcher() { super(UrzasMiterWatcher.class.getSimpleName(), WatcherScope.PLAYER); diff --git a/Mage.Sets/src/mage/cards/v/VileRedeemer.java b/Mage.Sets/src/mage/cards/v/VileRedeemer.java index 41661d91c3..505f892013 100644 --- a/Mage.Sets/src/mage/cards/v/VileRedeemer.java +++ b/Mage.Sets/src/mage/cards/v/VileRedeemer.java @@ -27,8 +27,6 @@ */ package mage.cards.v; -import java.util.HashMap; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; @@ -51,6 +49,10 @@ import mage.game.permanent.token.EldraziScionToken; import mage.players.Player; import mage.watchers.Watcher; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** * @author LevelX2 */ @@ -117,7 +119,7 @@ class VileRedeemerEffect extends OneShotEffect { class VileRedeemerNonTokenCreaturesDiedWatcher extends Watcher { - private final HashMap amountOfCreaturesThatDied = new HashMap<>(); + private final Map amountOfCreaturesThatDied = new HashMap<>(); public VileRedeemerNonTokenCreaturesDiedWatcher() { super(VileRedeemerNonTokenCreaturesDiedWatcher.class.getSimpleName(), WatcherScope.GAME); diff --git a/Mage.Sets/src/mage/cards/v/VoraciousDragon.java b/Mage.Sets/src/mage/cards/v/VoraciousDragon.java index b2738dd0f4..152e1ca10b 100644 --- a/Mage.Sets/src/mage/cards/v/VoraciousDragon.java +++ b/Mage.Sets/src/mage/cards/v/VoraciousDragon.java @@ -27,8 +27,6 @@ */ package mage.cards.v; -import java.util.ArrayList; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -46,6 +44,9 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreatureOrPlayer; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -93,7 +94,7 @@ class TwiceDevouredGoblins implements DynamicValue { if (abilityEffect instanceof DevourEffect) { DevourEffect devourEffect = (DevourEffect) abilityEffect; int amountGoblins = 0; - for (ArrayList subtypesItem :devourEffect.getSubtypes(game, sourcePermanent.getId())) { + for (List subtypesItem :devourEffect.getSubtypes(game, sourcePermanent.getId())) { if (subtypesItem.contains("Goblin")) { ++amountGoblins; } diff --git a/Mage.Sets/src/mage/cards/w/WakeTheDead.java b/Mage.Sets/src/mage/cards/w/WakeTheDead.java index 725b1ea4ba..10a11edab4 100644 --- a/Mage.Sets/src/mage/cards/w/WakeTheDead.java +++ b/Mage.Sets/src/mage/cards/w/WakeTheDead.java @@ -27,8 +27,6 @@ */ package mage.cards.w; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.SpellAbility; @@ -53,6 +51,10 @@ import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetpointer.FixedTargets; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author LevelX2 @@ -111,7 +113,7 @@ class WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEff if (controller != null) { Cards cards = new CardsImpl(getTargetPointer().getTargets(game, source)); controller.moveCards(cards, Zone.BATTLEFIELD, source, game); - ArrayList toSacrifice = new ArrayList<>(cards.size()); + List toSacrifice = new ArrayList<>(cards.size()); for (UUID targetId : cards) { Permanent creature = game.getPermanent(targetId); if (creature != null) { diff --git a/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java b/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java index 6757e42704..2eeb027bb3 100644 --- a/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java +++ b/Mage.Sets/src/mage/cards/w/WitchbaneOrb.java @@ -27,8 +27,6 @@ */ package mage.cards.w; -import java.util.ArrayList; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -44,6 +42,10 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author BetaSteward @@ -86,7 +88,7 @@ class WitchbaneOrbEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - ArrayList toDestroy = new ArrayList<>(); + List toDestroy = new ArrayList<>(); for (UUID attachmentId : controller.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); if (attachment != null && attachment.getSubtype(game).contains("Curse")) { diff --git a/Mage.Sets/src/mage/cards/w/WorldQueller.java b/Mage.Sets/src/mage/cards/w/WorldQueller.java index a96b574298..ede1c4738b 100644 --- a/Mage.Sets/src/mage/cards/w/WorldQueller.java +++ b/Mage.Sets/src/mage/cards/w/WorldQueller.java @@ -27,11 +27,6 @@ */ package mage.cards.w; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -52,6 +47,8 @@ import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; +import java.util.*; + /** * * @author jeffwadsworth @@ -82,7 +79,7 @@ public class WorldQueller extends CardImpl { class WorldQuellerEffect extends OneShotEffect { - private static final HashSet choice = new LinkedHashSet<>(); + private static final Set choice = new LinkedHashSet<>(); static { choice.add(CardType.ARTIFACT.toString()); diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index efe2eca536..bb7a8e8f9b 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -1,9 +1,10 @@ package mage.constants; +import mage.util.SubTypeList; + import java.util.Arrays; import java.util.Set; import java.util.stream.Collectors; -import mage.util.SubTypeList; public enum SubType { @@ -427,8 +428,8 @@ public enum SubType { return subTypes; } - public static Set getBasicLands(boolean customSet) { - return Arrays.stream(values()).filter(s -> s.customSet == customSet).filter(p -> p.getSubTypeSet() == SubTypeSet.BasicLandType).map(SubType::getDescription).collect(Collectors.toSet()); + public static Set getBasicLands(boolean customSet) { + return Arrays.stream(values()).filter(s -> s.customSet == customSet).filter(p -> p.getSubTypeSet() == SubTypeSet.BasicLandType).collect(Collectors.toSet()); } public static SubTypeList getLandTypes(boolean customSet) { diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index 46a5867299..6cfc22b324 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -7,9 +7,12 @@ package mage.filter; import mage.constants.CardType; import mage.constants.SubType; +import mage.constants.SuperType; import mage.filter.common.*; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.TokenPredicate; @@ -64,6 +67,26 @@ public final class StaticFilters { public static final FilterPermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures"); + + + public static final FilterPermanent FILTER_AURA = new FilterPermanent(); + public static final FilterPermanent FILTER_EQUIPMENT = new FilterPermanent(); + public static final FilterPermanent FILTER_FORTIFICATION = new FilterPermanent(); + public static final FilterPermanent FILTER_LEGENDARY = new FilterPermanent(); + + static { + FILTER_AURA.add(new CardTypePredicate(CardType.ENCHANTMENT)); + FILTER_AURA.add(new SubtypePredicate(SubType.AURA)); + + FILTER_EQUIPMENT.add(new CardTypePredicate(CardType.ARTIFACT)); + FILTER_EQUIPMENT.add(new SubtypePredicate(SubType.EQUIPMENT)); + + FILTER_FORTIFICATION.add(new CardTypePredicate(CardType.ARTIFACT)); + FILTER_FORTIFICATION.add(new SubtypePredicate(SubType.FORTIFICATION)); + + FILTER_LEGENDARY.add(new SupertypePredicate(SuperType.LEGENDARY)); + } + static { FILTER_CONTROLLED_PERMANENT_NON_LAND.add( Predicates.not(new CardTypePredicate(CardType.LAND))); diff --git a/Mage/src/main/java/mage/game/GameImpl.java b/Mage/src/main/java/mage/game/GameImpl.java index bf327ab678..41d2996498 100644 --- a/Mage/src/main/java/mage/game/GameImpl.java +++ b/Mage/src/main/java/mage/game/GameImpl.java @@ -54,9 +54,9 @@ import mage.designations.Monarch; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterPlaneswalkerPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; @@ -103,24 +103,6 @@ public abstract class GameImpl implements Game, Serializable { private static final Logger logger = Logger.getLogger(GameImpl.class); - private static final FilterPermanent FILTER_AURA = new FilterPermanent(); - private static final FilterPermanent FILTER_EQUIPMENT = new FilterPermanent(); - private static final FilterPermanent FILTER_FORTIFICATION = new FilterPermanent(); - private static final FilterPermanent FILTER_LEGENDARY = new FilterPermanent(); - - static { - FILTER_AURA.add(new CardTypePredicate(CardType.ENCHANTMENT)); - FILTER_AURA.add(new SubtypePredicate(SubType.AURA)); - - FILTER_EQUIPMENT.add(new CardTypePredicate(CardType.ARTIFACT)); - FILTER_EQUIPMENT.add(new SubtypePredicate(SubType.EQUIPMENT)); - - FILTER_FORTIFICATION.add(new CardTypePredicate(CardType.ARTIFACT)); - FILTER_FORTIFICATION.add(new SubtypePredicate(SubType.FORTIFICATION)); - - FILTER_LEGENDARY.add(new SupertypePredicate(SuperType.LEGENDARY)); - } - private transient Object customData; protected boolean simulation = false; @@ -1784,7 +1766,7 @@ public abstract class GameImpl implements Game, Serializable { if (perm.isWorld()) { worldEnchantment.add(perm); } - if (FILTER_AURA.match(perm, this)) { + if (StaticFilters.FILTER_AURA.match(perm, this)) { //20091005 - 704.5n, 702.14c if (perm.getAttachedTo() == null) { Card card = this.getCard(perm.getId()); @@ -1862,10 +1844,10 @@ public abstract class GameImpl implements Game, Serializable { } } } - if (this.getState().isLegendaryRuleActive() && FILTER_LEGENDARY.match(perm, this)) { + if (this.getState().isLegendaryRuleActive() && StaticFilters.FILTER_LEGENDARY.match(perm, this)) { legendary.add(perm); } - if (FILTER_EQUIPMENT.match(perm, this)) { + if (StaticFilters.FILTER_EQUIPMENT.match(perm, this)) { //20091005 - 704.5p, 702.14d if (perm.getAttachedTo() != null) { Permanent attachedTo = getPermanent(perm.getAttachedTo()); @@ -1890,7 +1872,7 @@ public abstract class GameImpl implements Game, Serializable { } } } - if (FILTER_FORTIFICATION.match(perm, this)) { + if (StaticFilters.FILTER_FORTIFICATION.match(perm, this)) { if (perm.getAttachedTo() != null) { Permanent land = getPermanent(perm.getAttachedTo()); if (land == null || !land.getAttachments().contains(perm.getId())) {