From 398744dfbe73bc31a1718d09d04b32c8235409ca Mon Sep 17 00:00:00 2001 From: xenohedron Date: Tue, 21 May 2024 00:57:32 -0400 Subject: [PATCH] add comments to CountersSourceCount for null param usage --- Mage.Sets/src/mage/cards/g/GavelOfTheRighteous.java | 2 +- Mage.Sets/src/mage/cards/h/HancockGhoulishMayor.java | 2 +- Mage.Sets/src/mage/cards/i/IndominusRexAlpha.java | 2 +- .../src/mage/cards/o/OmarthisGhostfireInitiate.java | 2 +- .../dynamicvalue/common/CountersSourceCount.java | 10 ++++++++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GavelOfTheRighteous.java b/Mage.Sets/src/mage/cards/g/GavelOfTheRighteous.java index 7b70b64eed9..dfd77502e98 100644 --- a/Mage.Sets/src/mage/cards/g/GavelOfTheRighteous.java +++ b/Mage.Sets/src/mage/cards/g/GavelOfTheRighteous.java @@ -33,7 +33,7 @@ import java.util.stream.IntStream; */ public final class GavelOfTheRighteous extends CardImpl { - private static final DynamicValue xValue = new CountersSourceCount(null); + private static final DynamicValue xValue = new CountersSourceCount(); public GavelOfTheRighteous(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}"); diff --git a/Mage.Sets/src/mage/cards/h/HancockGhoulishMayor.java b/Mage.Sets/src/mage/cards/h/HancockGhoulishMayor.java index 556eb608e64..7d3e17630ff 100644 --- a/Mage.Sets/src/mage/cards/h/HancockGhoulishMayor.java +++ b/Mage.Sets/src/mage/cards/h/HancockGhoulishMayor.java @@ -22,7 +22,7 @@ import java.util.UUID; */ public final class HancockGhoulishMayor extends CardImpl { - private static final DynamicValue xValue = new CountersSourceCount(null); + private static final DynamicValue xValue = new CountersSourceCount(); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { diff --git a/Mage.Sets/src/mage/cards/i/IndominusRexAlpha.java b/Mage.Sets/src/mage/cards/i/IndominusRexAlpha.java index 2b2a0642505..b039241e462 100644 --- a/Mage.Sets/src/mage/cards/i/IndominusRexAlpha.java +++ b/Mage.Sets/src/mage/cards/i/IndominusRexAlpha.java @@ -30,7 +30,7 @@ import mage.target.common.TargetDiscard; */ public final class IndominusRexAlpha extends CardImpl { - private static final DynamicValue xValue = new CountersSourceCount(null); + private static final DynamicValue xValue = new CountersSourceCount(); public IndominusRexAlpha(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U/B}{U/B}{G}{G}"); diff --git a/Mage.Sets/src/mage/cards/o/OmarthisGhostfireInitiate.java b/Mage.Sets/src/mage/cards/o/OmarthisGhostfireInitiate.java index 99b93e54006..d1326b3782c 100644 --- a/Mage.Sets/src/mage/cards/o/OmarthisGhostfireInitiate.java +++ b/Mage.Sets/src/mage/cards/o/OmarthisGhostfireInitiate.java @@ -58,7 +58,7 @@ public final class OmarthisGhostfireInitiate extends CardImpl { // When Omarthis dies, manifest a number of cards from the top of your library equal to the number of counters on it. this.addAbility(new DiesSourceTriggeredAbility( - new ManifestEffect(new CountersSourceCount(null)) + new ManifestEffect(new CountersSourceCount()) .setText("manifest a number of cards from the top of your library equal to the number of counters on it."), false )); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersSourceCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersSourceCount.java index 718268aa598..69c0e358f29 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersSourceCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CountersSourceCount.java @@ -12,6 +12,16 @@ public class CountersSourceCount implements DynamicValue { private final CounterType counterType; + /** + * Number of counters of any type on the source permanent + */ + public CountersSourceCount() { + this((CounterType) null); + } + + /** + * Number of counters of the specified type on the source permanent + */ public CountersSourceCount(CounterType counterType) { this.counterType = counterType; }