From 882afbf8b5a42692f9744dbf7dbfa3f2f399a20d Mon Sep 17 00:00:00 2001 From: DeepCrimson <> Date: Thu, 16 Jun 2022 14:53:44 -0700 Subject: [PATCH] Fix remaining raw unparameterized usages of ManaCostImpl --- .../src/mage/player/ai/SimulatedPlayer2.java | 2 +- .../conditional/ConditionalAsThoughTest.java | 4 ++-- .../mage/test/cards/copy/SparkDoubleTest.java | 2 +- .../mage/test/cards/mana/ManaPoolTest.java | 20 +++++++++---------- .../serverside/base/MageTestPlayerBase.java | 10 +++++----- .../main/java/mage/abilities/AbilityImpl.java | 2 +- .../abilities/abilityword/StriveAbility.java | 4 ++-- .../common/continuous/WUBRGInsteadEffect.java | 5 +++-- .../abilities/effects/keyword/EchoEffect.java | 4 ++-- .../effects/keyword/ManifestEffect.java | 5 +++-- .../keyword/ManifestTargetPlayerEffect.java | 5 +++-- .../mage/abilities/keyword/AdaptAbility.java | 2 +- .../abilities/keyword/BloodrushAbility.java | 2 +- .../abilities/keyword/BuybackAbility.java | 2 +- .../abilities/keyword/DisturbAbility.java | 4 ++-- .../mage/abilities/keyword/EchoAbility.java | 4 ++-- .../abilities/keyword/EntwineAbility.java | 2 +- .../mage/abilities/keyword/EscapeAbility.java | 2 +- .../mage/abilities/keyword/ExtortAbility.java | 8 ++++---- .../abilities/keyword/ForetellAbility.java | 4 ++-- .../mage/abilities/keyword/KickerAbility.java | 2 +- .../mage/abilities/keyword/MutateAbility.java | 2 +- .../abilities/keyword/SuspendAbility.java | 2 +- .../abilities/keyword/TransmuteAbility.java | 4 ++-- .../main/java/mage/cards/mock/MockCard.java | 2 +- .../java/mage/designations/Designation.java | 2 +- .../main/java/mage/game/command/Emblem.java | 2 +- .../main/java/mage/game/command/Plane.java | 2 +- .../ObNixilisOfTheBlackOathEmblem.java | 5 +++-- .../permanent/token/DeathpactAngelToken.java | 7 ++++--- .../permanent/token/DragonEggDragonToken.java | 2 +- .../token/GoldmeadowHarrierToken.java | 7 ++++--- .../game/permanent/token/LandMineToken.java | 5 +++-- .../token/NighteyesTheDesecratorToken.java | 7 ++++--- .../token/SengirNosferatuBatToken.java | 2 +- .../game/permanent/token/SplinterToken.java | 8 ++++---- .../main/java/mage/players/PlayerImpl.java | 6 +++--- 37 files changed, 84 insertions(+), 76 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java index 3f20cc6729..8a9eb62387 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java @@ -153,7 +153,7 @@ public class SimulatedPlayer2 extends ComputerPlayer { if (newAbility instanceof AbilityImpl) { xMultiplier = ((AbilityImpl) newAbility).handleManaXMultiplier(game, xMultiplier); } - newAbility.getManaCostsToPay().add(new ManaCostsImpl(new StringBuilder("{").append(xAnnounceValue).append('}').toString())); + newAbility.getManaCostsToPay().add(new ManaCostsImpl<>(new StringBuilder("{").append(xAnnounceValue).append('}').toString())); newAbility.getManaCostsToPay().setX(xAnnounceValue * xMultiplier, xAnnounceValue * xInstancesCount); if (varCost != null) { varCost.setPaid(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ConditionalAsThoughTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ConditionalAsThoughTest.java index 6077a23cf1..cabea5788c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ConditionalAsThoughTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/ConditionalAsThoughTest.java @@ -73,7 +73,7 @@ public class ConditionalAsThoughTest extends CardTestPlayerBase { Ability ability = new SimpleActivatedAbility( Zone.ALL, new InfoEffect("test"), - new ManaCostsImpl("{R}") + new ManaCostsImpl<>("{R}") ); ability.addTarget(new TargetCardInLibrary()); } @@ -94,7 +94,7 @@ public class ConditionalAsThoughTest extends CardTestPlayerBase { 0 ) ).setText("allow target cast"), - new ManaCostsImpl("{R}") + new ManaCostsImpl<>("{R}") ); ability.addTarget(new TargetCardInOpponentsGraveyard(StaticFilters.FILTER_CARD)); addCustomCardWithAbility("play any opponent hand", playerA, ability); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/SparkDoubleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/SparkDoubleTest.java index 300c0fd0ba..e8b5bf9323 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/SparkDoubleTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/SparkDoubleTest.java @@ -207,7 +207,7 @@ public class SparkDoubleTest extends CardTestPlayerBase { @Test public void test_CopyOfSparksCopy_ByAbility() { - Ability ability = new SimpleActivatedAbility(new CreateTokenCopyTargetEffect(), new ManaCostsImpl("")); + Ability ability = new SimpleActivatedAbility(new CreateTokenCopyTargetEffect(), new ManaCostsImpl<>("")); ability.addTarget(new TargetPermanent()); addCustomCardWithAbility("copy", playerA, ability); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaPoolTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaPoolTest.java index 1fecee7419..fdfaf0ea67 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaPoolTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ManaPoolTest.java @@ -171,7 +171,7 @@ public class ManaPoolTest extends CardTestPlayerBase { public void test_ConditionalMana_OneXSpell() { addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new InstantOrSorcerySpellManaBuilder()), - new ManaCostsImpl(""))); + new ManaCostsImpl<>(""))); addCard(Zone.HAND, playerA, "Volcanic Geyser"); // {X}{R}{R} // make mana @@ -197,7 +197,7 @@ public class ManaPoolTest extends CardTestPlayerBase { public void test_ConditionalMana_MultipleXSpell() { addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new InstantOrSorcerySpellManaBuilder()), - new ManaCostsImpl(""))); + new ManaCostsImpl<>(""))); addCard(Zone.HAND, playerA, "Volcanic Geyser", 2); // {X}{R}{R} // make mana @@ -229,7 +229,7 @@ public class ManaPoolTest extends CardTestPlayerBase { public void test_MultipleMana_OneXAbility() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); // - Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("{X}")); + Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("{X}")); ability.addTarget(new TargetAnyTarget()); addCustomCardWithAbility("damage X", playerA, ability); @@ -259,9 +259,9 @@ public class ManaPoolTest extends CardTestPlayerBase { public void test_ConditionalMana_OneXAbility() { addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new SimpleActivatedAbilityManaBuilder()), - new ManaCostsImpl(""))); + new ManaCostsImpl<>(""))); // - Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("{X}")); + Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("{X}")); ability.addTarget(new TargetAnyTarget()); addCustomCardWithAbility("damage X", playerA, ability); @@ -289,12 +289,12 @@ public class ManaPoolTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Bolt"); // {R} addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1 + 3 + 1); // - Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("")); + Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("")); ability.addTarget(new TargetAnyTarget()); addCustomCardWithAbility("damage X", playerA, ability); // // {X}: Counter target spell - ability = new SimpleActivatedAbility(Zone.ALL, new CounterUnlessPaysEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("{X}")); + ability = new SimpleActivatedAbility(Zone.ALL, new CounterUnlessPaysEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("{X}")); ability.addTarget(new TargetSpell()); addCustomCardWithAbility("counter until pay X", playerB, ability); addCard(Zone.BATTLEFIELD, playerB, "Island", 3); @@ -336,14 +336,14 @@ public class ManaPoolTest extends CardTestPlayerBase { // addCustomCardWithAbility("add 10", playerA, new SimpleManaAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new SimpleActivatedAbilityManaBuilder()), - new ManaCostsImpl(""))); + new ManaCostsImpl<>(""))); // - Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("")); + Ability ability = new SimpleActivatedAbility(Zone.ALL, new DamageTargetEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("")); ability.addTarget(new TargetAnyTarget()); addCustomCardWithAbility("damage X", playerA, ability); // // {X}: Counter target spell - ability = new SimpleActivatedAbility(Zone.ALL, new CounterUnlessPaysEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl("{X}")); + ability = new SimpleActivatedAbility(Zone.ALL, new CounterUnlessPaysEffect(ManacostVariableValue.REGULAR), new ManaCostsImpl<>("{X}")); ability.addTarget(new TargetSpell()); addCustomCardWithAbility("counter until pay X", playerB, ability); addCard(Zone.BATTLEFIELD, playerB, "Island", 3); diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java index 6725189020..73ae45eef5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java @@ -487,7 +487,7 @@ public abstract class MageTestPlayerBase { * @param damageAmount */ protected void addCustomEffect_TargetDamage(TestPlayer controller, int damageAmount) { - Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(damageAmount).setText("target damage " + damageAmount), new ManaCostsImpl("")); + Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(damageAmount).setText("target damage " + damageAmount), new ManaCostsImpl<>("")); ability.addTarget(new TargetAnyTarget()); addCustomCardWithAbility( "target damage " + damageAmount + " for " + controller.getName(), @@ -502,7 +502,7 @@ public abstract class MageTestPlayerBase { * @param controller */ protected void addCustomEffect_DestroyTarget(TestPlayer controller) { - Ability ability = new SimpleActivatedAbility(new DestroyTargetEffect().setText("target destroy"), new ManaCostsImpl("")); + Ability ability = new SimpleActivatedAbility(new DestroyTargetEffect().setText("target destroy"), new ManaCostsImpl<>("")); ability.addTarget(new TargetPermanent()); addCustomCardWithAbility( "target destroy for " + controller.getName(), @@ -518,7 +518,7 @@ public abstract class MageTestPlayerBase { */ protected void addCustomEffect_ReturnFromAnyToHand(TestPlayer controller) { // graveyard - Ability ability = new SimpleActivatedAbility(new ReturnFromGraveyardToHandTargetEffect().setText("return from graveyard"), new ManaCostsImpl("")); + Ability ability = new SimpleActivatedAbility(new ReturnFromGraveyardToHandTargetEffect().setText("return from graveyard"), new ManaCostsImpl<>("")); ability.addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD)); addCustomCardWithAbility( "return from graveyard for " + controller.getName(), @@ -527,7 +527,7 @@ public abstract class MageTestPlayerBase { ); // exile - ability = new SimpleActivatedAbility(new ReturnFromExileEffect(Zone.HAND).setText("return from exile"), new ManaCostsImpl("")); + ability = new SimpleActivatedAbility(new ReturnFromExileEffect(Zone.HAND).setText("return from exile"), new ManaCostsImpl<>("")); ability.addTarget(new TargetCardInExile(StaticFilters.FILTER_CARD)); addCustomCardWithAbility( "return from exile for " + controller.getName(), @@ -536,7 +536,7 @@ public abstract class MageTestPlayerBase { ); // library - ability = new SimpleActivatedAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD)).setText("return from library"), new ManaCostsImpl("")); + ability = new SimpleActivatedAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD)).setText("return from library"), new ManaCostsImpl<>("")); addCustomCardWithAbility( "return from library for " + controller.getName(), controller, diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index 7d987a8132..ea8e24be58 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -626,7 +626,7 @@ public abstract class AbilityImpl implements Ability { manaString.append('{').append(manaSymbol).append('}'); } } - manaCostsToPay.add(new ManaCostsImpl(manaString.toString())); + manaCostsToPay.add(new ManaCostsImpl<>(manaString.toString())); manaCostsToPay.setX(xValue * xValueMultiplier, amountMana); } variableManaCost.setPaid(); diff --git a/Mage/src/main/java/mage/abilities/abilityword/StriveAbility.java b/Mage/src/main/java/mage/abilities/abilityword/StriveAbility.java index 0f63428318..11db3aa2b4 100644 --- a/Mage/src/main/java/mage/abilities/abilityword/StriveAbility.java +++ b/Mage/src/main/java/mage/abilities/abilityword/StriveAbility.java @@ -19,7 +19,7 @@ public class StriveAbility extends SimpleStaticAbility { private final String striveCost; public StriveAbility(String manaString) { - super(Zone.STACK, new StriveCostIncreasingEffect(new ManaCostsImpl(manaString))); + super(Zone.STACK, new StriveCostIncreasingEffect(new ManaCostsImpl<>(manaString))); setRuleAtTheTop(true); this.striveCost = manaString; setAbilityWord(AbilityWord.STRIVE); @@ -67,7 +67,7 @@ class StriveCostIncreasingEffect extends CostModificationEffectImpl { sb.append(striveCosts.getText()); } String finalCost = ManaUtil.condenseManaCostString(sb.toString()); - abilityToModify.getManaCostsToPay().add(new ManaCostsImpl(finalCost)); + abilityToModify.getManaCostsToPay().add(new ManaCostsImpl<>(finalCost)); return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/WUBRGInsteadEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/WUBRGInsteadEffect.java index 4aae264650..20858cec0b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/WUBRGInsteadEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/WUBRGInsteadEffect.java @@ -1,7 +1,6 @@ package mage.abilities.effects.common.continuous; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.condition.common.SourceIsSpellCondition; import mage.abilities.costs.AlternativeCostSourceAbility; @@ -14,13 +13,15 @@ import mage.constants.SubLayer; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * @author JRHerlehy * Created on 4/4/18. */ public class WUBRGInsteadEffect extends ContinuousEffectImpl { - private final AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new ManaCostsImpl("{W}{U}{B}{R}{G}"), SourceIsSpellCondition.instance); + private final AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(new ManaCostsImpl<>("{W}{U}{B}{R}{G}"), SourceIsSpellCondition.instance); public WUBRGInsteadEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/EchoEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/EchoEffect.java index 38fed94a70..8f9a058608 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/EchoEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/EchoEffect.java @@ -41,13 +41,13 @@ public class EchoEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { if (cost == null) { - cost = new ManaCostsImpl(Integer.toString(amount.calculate(game, source, this))); + cost = new ManaCostsImpl<>(Integer.toString(amount.calculate(game, source, this))); } Player controller = game.getPlayer(source.getControllerId()); if (controller != null && source.getSourceObjectIfItStillExists(game) != null) { if (game.getContinuousEffects().asThough(source.getSourceId(), AsThoughEffectType.PAY_0_ECHO, source, source.getControllerId(), game) != null) { - Cost altCost = new ManaCostsImpl("{0}"); + Cost altCost = new ManaCostsImpl<>("{0}"); if (controller.chooseUse(Outcome.Benefit, "Pay {0} instead of the echo cost?", source, game)) { altCost.clearPaid(); if (altCost.pay(source, game, source, source.getControllerId(), false, null)) { diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java index 1844b0d3bd..09d4f45b86 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestEffect.java @@ -1,7 +1,6 @@ package mage.abilities.effects.keyword; -import java.util.Set; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCosts; @@ -18,6 +17,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; +import java.util.Set; + /** * * @author LevelX2 @@ -54,7 +55,7 @@ public class ManifestEffect extends OneShotEffect { if (card.isCreature(game)) { manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null; if (manaCosts == null) { - manaCosts = new ManaCostsImpl("{0}"); + manaCosts = new ManaCostsImpl<>("{0}"); } } MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game); diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java index 2aa3c91af3..5c01ba9e25 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java @@ -1,7 +1,6 @@ package mage.abilities.effects.keyword; -import java.util.Set; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCosts; @@ -18,6 +17,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; +import java.util.Set; + /** * * @author LevelX2 @@ -57,7 +58,7 @@ public class ManifestTargetPlayerEffect extends OneShotEffect { if (card.isCreature(game)) { manaCosts = card.getSpellAbility().getManaCosts(); if (manaCosts == null) { - manaCosts = new ManaCostsImpl("{0}"); + manaCosts = new ManaCostsImpl<>("{0}"); } } MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game); diff --git a/Mage/src/main/java/mage/abilities/keyword/AdaptAbility.java b/Mage/src/main/java/mage/abilities/keyword/AdaptAbility.java index 65d037d8c1..2ddbaaa4ec 100644 --- a/Mage/src/main/java/mage/abilities/keyword/AdaptAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/AdaptAbility.java @@ -13,7 +13,7 @@ import mage.constants.Zone; public class AdaptAbility extends ActivatedAbilityImpl { public AdaptAbility(int adaptNumber, String manaCost) { - super(Zone.BATTLEFIELD, new AdaptEffect(adaptNumber), new ManaCostsImpl(manaCost)); + super(Zone.BATTLEFIELD, new AdaptEffect(adaptNumber), new ManaCostsImpl<>(manaCost)); } private AdaptAbility(final AdaptAbility ability) { diff --git a/Mage/src/main/java/mage/abilities/keyword/BloodrushAbility.java b/Mage/src/main/java/mage/abilities/keyword/BloodrushAbility.java index 30a2b45ac3..a89df343cf 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BloodrushAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BloodrushAbility.java @@ -24,7 +24,7 @@ import mage.target.common.TargetAttackingCreature; public class BloodrushAbility extends ActivatedAbilityImpl { public BloodrushAbility(String manaString, Effect effect) { - super(Zone.HAND, effect, new ManaCostsImpl(manaString)); + super(Zone.HAND, effect, new ManaCostsImpl<>(manaString)); this.addCost(new DiscardSourceCost()); this.addTarget(new TargetAttackingCreature()); this.setAbilityWord(AbilityWord.BLOODRUSH); diff --git a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java index 9e20f64e2a..6dca62861b 100644 --- a/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/BuybackAbility.java @@ -42,7 +42,7 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS public BuybackAbility(String manaString) { super(Zone.STACK, new BuybackEffect()); - addBuybackCostAndSetup(new OptionalAdditionalCostImpl(keywordText, reminderTextMana, new ManaCostsImpl(manaString))); + addBuybackCostAndSetup(new OptionalAdditionalCostImpl(keywordText, reminderTextMana, new ManaCostsImpl<>(manaString))); setRuleAtTheTop(true); } diff --git a/Mage/src/main/java/mage/abilities/keyword/DisturbAbility.java b/Mage/src/main/java/mage/abilities/keyword/DisturbAbility.java index 7a87c5dea3..4a6d344166 100644 --- a/Mage/src/main/java/mage/abilities/keyword/DisturbAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/DisturbAbility.java @@ -46,7 +46,7 @@ public class DisturbAbility extends SpellAbility { this.manaCost = manaCost; this.getManaCosts().clear(); this.getManaCostsToPay().clear(); - this.addManaCost(new ManaCostsImpl(manaCost)); + this.addManaCost(new ManaCostsImpl<>(manaCost)); this.addSubAbility(new TransformAbility()); } @@ -126,4 +126,4 @@ class DisturbEffect extends ContinuousEffectImpl { TransformAbility.transformCardSpellDynamic(spell, spell.getCard().getSecondCardFace(), game); return true; } -} \ No newline at end of file +} diff --git a/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java b/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java index 451fa864ca..2402dbe1df 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EchoAbility.java @@ -26,9 +26,9 @@ public class EchoAbility extends TriggeredAbilityImpl { private String rule; public EchoAbility(String manaString) { - super(Zone.BATTLEFIELD, new EchoEffect(new ManaCostsImpl(manaString)), false); + super(Zone.BATTLEFIELD, new EchoEffect(new ManaCostsImpl<>(manaString)), false); this.echoPaid = false; - this.echoCosts.add(new ManaCostsImpl(manaString)); + this.echoCosts.add(new ManaCostsImpl<>(manaString)); this.lastController = null; this.rule = null; } diff --git a/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java b/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java index 0b299abd14..8bd4837f33 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EntwineAbility.java @@ -38,7 +38,7 @@ public class EntwineAbility extends StaticAbility implements OptionalAdditionalM public EntwineAbility(String manaString) { super(Zone.STACK, null); - addEntwineCostAndSetup(new OptionalAdditionalCostImpl(keywordText, reminderText, new ManaCostsImpl(manaString))); + addEntwineCostAndSetup(new OptionalAdditionalCostImpl(keywordText, reminderText, new ManaCostsImpl<>(manaString))); } public EntwineAbility(Cost cost) { diff --git a/Mage/src/main/java/mage/abilities/keyword/EscapeAbility.java b/Mage/src/main/java/mage/abilities/keyword/EscapeAbility.java index f4a009a3cf..8eb1f11857 100644 --- a/Mage/src/main/java/mage/abilities/keyword/EscapeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/EscapeAbility.java @@ -40,7 +40,7 @@ public class EscapeAbility extends SpellAbility { this.exileCount = exileCount; this.getManaCosts().clear(); this.getManaCostsToPay().clear(); - this.addManaCost(new ManaCostsImpl(manaCost)); + this.addManaCost(new ManaCostsImpl<>(manaCost)); this.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(exileCount, filter), "")); // hide additional cost text from rules } diff --git a/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java b/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java index b522cc6e01..cb2d97be0d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ExtortAbility.java @@ -2,20 +2,20 @@ package mage.abilities.keyword; -import java.util.UUID; - -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.Cost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** * FAQ 2013/01/11 * @@ -76,7 +76,7 @@ class ExtortEffect extends OneShotEffect { Permanent permanent = game.getPermanent(source.getSourceId()); if (player != null && permanent != null) { if (player.chooseUse(Outcome.Damage, new StringBuilder("Extort opponents? (").append(permanent.getName()).append(')').toString(), source, game)) { - Cost cost = new ManaCostsImpl("{W/B}"); + Cost cost = new ManaCostsImpl<>("{W/B}"); if (cost.pay(source, game, source, player.getId(), false, null)) { int loseLife = 0; for (UUID opponentId : game.getOpponents(source.getControllerId())) { diff --git a/Mage/src/main/java/mage/abilities/keyword/ForetellAbility.java b/Mage/src/main/java/mage/abilities/keyword/ForetellAbility.java index 8f4d5f26cb..62c464091b 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ForetellAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ForetellAbility.java @@ -18,13 +18,13 @@ import mage.cards.*; import mage.constants.*; import mage.game.ExileZone; import mage.game.Game; +import mage.game.events.GameEvent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; import mage.watchers.common.ForetoldWatcher; import java.util.UUID; -import mage.game.events.GameEvent; /** * @author jeffwadsworth @@ -312,7 +312,7 @@ public class ForetellAbility extends SpecialAction { } this.setAdditionalCostsRuleVisible(false); this.name = "Foretell " + foretellCost; - this.addCost(new ManaCostsImpl(foretellCost)); + this.addCost(new ManaCostsImpl<>(foretellCost)); } public ForetellCostAbility(final ForetellCostAbility ability) { diff --git a/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java b/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java index cdf4e4ee6f..37c90cc066 100644 --- a/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/KickerAbility.java @@ -96,7 +96,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo public final OptionalAdditionalCost addKickerCost(String manaString) { OptionalAdditionalCost newCost = new OptionalAdditionalCostImpl( - keywordText, reminderText, new ManaCostsImpl(manaString)); + keywordText, reminderText, new ManaCostsImpl<>(manaString)); addKickerCostAndSetup(newCost); return newCost; } diff --git a/Mage/src/main/java/mage/abilities/keyword/MutateAbility.java b/Mage/src/main/java/mage/abilities/keyword/MutateAbility.java index 83872f3ebe..7bac5f0e4f 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MutateAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MutateAbility.java @@ -9,7 +9,7 @@ import mage.constants.TimingRule; public class MutateAbility extends SpellAbility { public MutateAbility(Card card, String manaString) { - super(new ManaCostsImpl(manaString), card.getName() + " using mutate"); + super(new ManaCostsImpl<>(manaString), card.getName() + " using mutate"); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.timing = TimingRule.SORCERY; // TODO: Implement this diff --git a/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java b/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java index f3ae5a2748..b1cef02eaf 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SuspendAbility.java @@ -132,7 +132,7 @@ public class SuspendAbility extends SpecialAction { VariableManaCost xCosts = new VariableManaCost(VariableCostType.ALTERNATIVE); xCosts.setMinX(1); this.addManaCost(xCosts); - cost = new ManaCostsImpl("{X}" + cost.getText()); + cost = new ManaCostsImpl<>("{X}" + cost.getText()); } StringBuilder sb = new StringBuilder("Suspend "); if (cost != null) { diff --git a/Mage/src/main/java/mage/abilities/keyword/TransmuteAbility.java b/Mage/src/main/java/mage/abilities/keyword/TransmuteAbility.java index cc246c4804..0664148167 100644 --- a/Mage/src/main/java/mage/abilities/keyword/TransmuteAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/TransmuteAbility.java @@ -2,13 +2,13 @@ package mage.abilities.keyword; import mage.MageObject; import mage.abilities.Ability; -import mage.constants.ComparisonType; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.ComparisonType; import mage.constants.Outcome; import mage.constants.TimingRule; import mage.constants.Zone; @@ -39,7 +39,7 @@ import mage.target.common.TargetCardInLibrary; public class TransmuteAbility extends SimpleActivatedAbility { public TransmuteAbility(String manaCost) { - super(Zone.HAND, new TransmuteEffect(), new ManaCostsImpl(manaCost)); + super(Zone.HAND, new TransmuteEffect(), new ManaCostsImpl<>(manaCost)); this.setTiming(TimingRule.SORCERY); this.addCost(new DiscardSourceCost()); } diff --git a/Mage/src/main/java/mage/cards/mock/MockCard.java b/Mage/src/main/java/mage/cards/mock/MockCard.java index d8c2e22ed0..6136be28e9 100644 --- a/Mage/src/main/java/mage/cards/mock/MockCard.java +++ b/Mage/src/main/java/mage/cards/mock/MockCard.java @@ -49,7 +49,7 @@ public class MockCard extends CardImpl { this.usesVariousArt = card.usesVariousArt(); - //this.manaCost = new ManaCostsImpl(join(card.getManaCosts(CardInfo.ManaCostSide.ALL))); + //this.manaCost = new ManaCostsImpl<>(join(card.getManaCosts(CardInfo.ManaCostSide.ALL))); this.manaCostLeftStr = card.getManaCosts(CardInfo.ManaCostSide.LEFT); this.manaCostRightStr = card.getManaCosts(CardInfo.ManaCostSide.RIGHT); this.manaCostStr = card.getManaCosts(CardInfo.ManaCostSide.ALL); diff --git a/Mage/src/main/java/mage/designations/Designation.java b/Mage/src/main/java/mage/designations/Designation.java index bc4584fff8..059968951f 100644 --- a/Mage/src/main/java/mage/designations/Designation.java +++ b/Mage/src/main/java/mage/designations/Designation.java @@ -30,7 +30,7 @@ public abstract class Designation implements MageObject { private static final List emptySet = new ArrayList<>(); private static final ObjectColor emptyColor = new ObjectColor(); - private static final ManaCostsImpl emptyCost = new ManaCostsImpl(); + private static final ManaCostsImpl emptyCost = new ManaCostsImpl<>(); private String name; private final DesignationType designationType; diff --git a/Mage/src/main/java/mage/game/command/Emblem.java b/Mage/src/main/java/mage/game/command/Emblem.java index 1372ababdd..5baa39ea1b 100644 --- a/Mage/src/main/java/mage/game/command/Emblem.java +++ b/Mage/src/main/java/mage/game/command/Emblem.java @@ -33,7 +33,7 @@ public class Emblem implements CommandObject { private static List emptySet = new ArrayList<>(); private static ObjectColor emptyColor = new ObjectColor(); - private static ManaCosts emptyCost = new ManaCostsImpl(); + private static ManaCosts emptyCost = new ManaCostsImpl<>(); private String name = ""; private UUID id; diff --git a/Mage/src/main/java/mage/game/command/Plane.java b/Mage/src/main/java/mage/game/command/Plane.java index 1d44b5e4e5..a3a3c31e64 100644 --- a/Mage/src/main/java/mage/game/command/Plane.java +++ b/Mage/src/main/java/mage/game/command/Plane.java @@ -36,7 +36,7 @@ public class Plane implements CommandObject { private static List emptySet = new ArrayList<>(); private static ObjectColor emptyColor = new ObjectColor(); - private static ManaCosts emptyCost = new ManaCostsImpl(); + private static ManaCosts emptyCost = new ManaCostsImpl<>(); private Planes planeType = null; private UUID id; diff --git a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java index 4131d1b323..aca4a6e49e 100644 --- a/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/ObNixilisOfTheBlackOathEmblem.java @@ -11,10 +11,11 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.constants.Zone; -import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; import mage.game.command.Emblem; import mage.target.common.TargetControlledCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; + /** * * @author spjspj @@ -27,7 +28,7 @@ public final class ObNixilisOfTheBlackOathEmblem extends Emblem { DynamicValue xValue = SacrificeCostCreaturesPower.instance; Effect effect = new GainLifeEffect(xValue); effect.setText("You gain X life"); - Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl<>("{1}{B}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); effect = new DrawCardSourceControllerEffect(xValue); effect.setText("and draw X cards, where X is the sacrificed creature's power"); diff --git a/Mage/src/main/java/mage/game/permanent/token/DeathpactAngelToken.java b/Mage/src/main/java/mage/game/permanent/token/DeathpactAngelToken.java index 5185271831..ebce3bfc5d 100644 --- a/Mage/src/main/java/mage/game/permanent/token/DeathpactAngelToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/DeathpactAngelToken.java @@ -1,8 +1,7 @@ package mage.game.permanent.token; -import mage.constants.CardType; -import mage.constants.SubType; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -10,6 +9,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.constants.CardType; +import mage.constants.SubType; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.NamePredicate; @@ -41,7 +42,7 @@ public final class DeathpactAngelToken extends TokenImpl { power = new MageInt(1); toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ManaCostsImpl("{3}{W}{B}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ManaCostsImpl<>("{3}{W}{B}{B}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCardInYourGraveyard(filter)); diff --git a/Mage/src/main/java/mage/game/permanent/token/DragonEggDragonToken.java b/Mage/src/main/java/mage/game/permanent/token/DragonEggDragonToken.java index 891a296457..795448041c 100644 --- a/Mage/src/main/java/mage/game/permanent/token/DragonEggDragonToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/DragonEggDragonToken.java @@ -26,7 +26,7 @@ public final class DragonEggDragonToken extends TokenImpl { toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl<>("{R}"))); availableImageSetCodes = Arrays.asList("C18", "EMA", "M14", "M15", "M19", "CMR", "IMA", "GN2"); } diff --git a/Mage/src/main/java/mage/game/permanent/token/GoldmeadowHarrierToken.java b/Mage/src/main/java/mage/game/permanent/token/GoldmeadowHarrierToken.java index 457d5d4f57..2df00fa014 100644 --- a/Mage/src/main/java/mage/game/permanent/token/GoldmeadowHarrierToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/GoldmeadowHarrierToken.java @@ -1,14 +1,15 @@ package mage.game.permanent.token; -import mage.constants.CardType; -import mage.constants.SubType; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.TapTargetEffect; +import mage.constants.CardType; +import mage.constants.SubType; import mage.constants.Zone; import mage.target.common.TargetCreaturePermanent; @@ -27,7 +28,7 @@ public final class GoldmeadowHarrierToken extends TokenImpl { power = new MageInt(1); toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl<>("{W}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage/src/main/java/mage/game/permanent/token/LandMineToken.java b/Mage/src/main/java/mage/game/permanent/token/LandMineToken.java index 99135f4710..1da46a84bc 100644 --- a/Mage/src/main/java/mage/game/permanent/token/LandMineToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/LandMineToken.java @@ -1,13 +1,14 @@ package mage.game.permanent.token; -import mage.constants.CardType; + import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.FlyingAbility; +import mage.constants.CardType; import mage.constants.Zone; import mage.filter.common.FilterAttackingCreature; import mage.filter.predicate.Predicates; @@ -31,7 +32,7 @@ public final class LandMineToken extends TokenImpl { this.setOriginalExpansionSetCode("M15"); cardType.add(CardType.ARTIFACT); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl<>("{R}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); diff --git a/Mage/src/main/java/mage/game/permanent/token/NighteyesTheDesecratorToken.java b/Mage/src/main/java/mage/game/permanent/token/NighteyesTheDesecratorToken.java index 3490ecd0f0..379ff1f65d 100644 --- a/Mage/src/main/java/mage/game/permanent/token/NighteyesTheDesecratorToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/NighteyesTheDesecratorToken.java @@ -1,13 +1,14 @@ package mage.game.permanent.token; -import mage.constants.CardType; -import mage.constants.SubType; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.constants.CardType; +import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; @@ -29,7 +30,7 @@ public final class NighteyesTheDesecratorToken extends TokenImpl { power = new MageInt(4); toughness = new MageInt(2); // {4}{B}: Put target creature card from a graveyard onto the battlefield under your control. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ManaCostsImpl("{4}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ManaCostsImpl<>("{4}{B}")); ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); this.addAbility(ability); } diff --git a/Mage/src/main/java/mage/game/permanent/token/SengirNosferatuBatToken.java b/Mage/src/main/java/mage/game/permanent/token/SengirNosferatuBatToken.java index c5c487f5bd..1baa8e4baf 100644 --- a/Mage/src/main/java/mage/game/permanent/token/SengirNosferatuBatToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/SengirNosferatuBatToken.java @@ -40,7 +40,7 @@ public final class SengirNosferatuBatToken extends TokenImpl { // {1}{B}, Sacrifice this creature: Return an exiled card named Sengir Nosferatu to the battlefield under its owner’s control. ReturnSengirNosferatuEffect effect = new ReturnSengirNosferatuEffect(); effect.setText("Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control."); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{B}")); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); diff --git a/Mage/src/main/java/mage/game/permanent/token/SplinterToken.java b/Mage/src/main/java/mage/game/permanent/token/SplinterToken.java index 2597d256c6..e89cf2b35c 100644 --- a/Mage/src/main/java/mage/game/permanent/token/SplinterToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/SplinterToken.java @@ -1,12 +1,12 @@ package mage.game.permanent.token; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.constants.CardType; -import mage.constants.SubType; import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.keyword.CumulativeUpkeepAbility; import mage.abilities.keyword.FlyingAbility; +import mage.constants.CardType; +import mage.constants.SubType; /** * @@ -22,7 +22,7 @@ public final class SplinterToken extends TokenImpl { power = new MageInt(1); toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{G}"))); + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl<>("{G}"))); } public SplinterToken(final SplinterToken token) { diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index 65508fb1cc..047a178c98 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -3297,7 +3297,7 @@ public abstract class PlayerImpl implements Player, Serializable { for (Permanent permanent : game.getBattlefield().getActivePermanents(playerId, game)) { // Some permanents allow use of abilities from non controlling players. so check all permanents in range Boolean canUse = null; boolean canAdd = false; - boolean useLater = false; // sources with mana costs or mana pool dependency + boolean useLater = false; // sources with mana costs or mana pool dependency Abilities manaAbilities = permanent.getAbilities(game).getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, playerId, game); // returns ability only if canActivate is true for (Iterator it = manaAbilities.iterator(); it.hasNext(); ) { @@ -3606,7 +3606,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (alternateSourceCostsAbility instanceof AlternativeSourceCosts) { if (((AlternativeSourceCosts) alternateSourceCostsAbility).isAvailable(ability, game)) { if (alternateSourceCostsAbility.getCosts().canPay(ability, ability, playerId, game)) { - ManaCostsImpl manaCosts = new ManaCostsImpl(); + ManaCostsImpl manaCosts = new ManaCostsImpl<>(); for (Cost cost : alternateSourceCostsAbility.getCosts()) { // AlternativeCost2 replaced by real cost on activate, so getPlayable need to extract that costs here if (cost instanceof AlternativeCost) { @@ -3655,7 +3655,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (alternateSourceCosts instanceof Ability) { if (alternateSourceCosts.isAvailable(ability, game)) { if (((Ability) alternateSourceCosts).getCosts().canPay(ability, ability, playerId, game)) { - ManaCostsImpl manaCosts = new ManaCostsImpl(); + ManaCostsImpl manaCosts = new ManaCostsImpl<>(); for (Cost cost : ((Ability) alternateSourceCosts).getCosts()) { // AlternativeCost2 replaced by real cost on activate, so getPlayable need to extract that costs here if (cost instanceof AlternativeCost) {