From c4eeec1bb213010d6510ccd3586c6784197da69f Mon Sep 17 00:00:00 2001 From: Ingmar Goudt Date: Sat, 16 Mar 2019 08:35:26 +0100 Subject: [PATCH] changed the constructor for a Watcher. Before, you had to explictly pass the name of the watcher as an argument. But most of the time this was the name of the class itself. So the watcher now determines internally its name. The method 'getBasicKey' can be overridden. Also updated some encapsulation --- .../mage/cards/a/AbandonedSarcophagus.java | 2 +- .../src/mage/cards/a/AdmiralBeckettBrass.java | 2 +- .../mage/cards/a/ApproachOfTheSecondSun.java | 2 +- Mage.Sets/src/mage/cards/a/ArchiveTrap.java | 2 +- .../src/mage/cards/a/ArclightPhoenix.java | 2 +- .../src/mage/cards/a/AsmiraHolyAvenger.java | 2 +- Mage.Sets/src/mage/cards/a/AureliasFury.java | 2 +- Mage.Sets/src/mage/cards/b/Berserk.java | 2 +- Mage.Sets/src/mage/cards/b/BlazingEffigy.java | 4 ++-- .../mage/cards/b/BoseijuWhoSheltersAll.java | 2 +- .../BurningCinderFuryOfCrimsonChaosFire.java | 2 +- .../src/mage/cards/c/CallerOfTheClaw.java | 2 +- .../src/mage/cards/c/CathedralMembrane.java | 2 +- Mage.Sets/src/mage/cards/c/CavernOfSouls.java | 2 +- .../src/mage/cards/c/CerebralVortex.java | 2 +- Mage.Sets/src/mage/cards/c/CobraTrap.java | 4 ++-- Mage.Sets/src/mage/cards/c/ConduitOfRuin.java | 2 +- Mage.Sets/src/mage/cards/c/CorrosiveOoze.java | 4 ++-- .../src/mage/cards/c/CustodiSoulcaller.java | 9 +++----- Mage.Sets/src/mage/cards/c/CyclopeanTomb.java | 2 +- .../src/mage/cards/d/DarkbladeAgent.java | 2 +- Mage.Sets/src/mage/cards/d/Desolation.java | 2 +- .../src/mage/cards/d/DiseasedVermin.java | 2 +- Mage.Sets/src/mage/cards/d/DreamSalvage.java | 2 +- Mage.Sets/src/mage/cards/d/DungeonGeists.java | 2 +- .../src/mage/cards/e/ErdwalIlluminator.java | 2 +- .../src/mage/cards/e/EtherswornCanonist.java | 2 +- .../mage/cards/f/FairgroundsTrumpeter.java | 2 +- Mage.Sets/src/mage/cards/f/FaithsReward.java | 2 +- Mage.Sets/src/mage/cards/f/FellShepherd.java | 2 +- Mage.Sets/src/mage/cards/f/FleshAllergy.java | 2 +- .../src/mage/cards/f/FreeRangeChicken.java | 2 +- .../src/mage/cards/g/GarnaTheBloodflame.java | 2 +- .../src/mage/cards/g/GeneratorServant.java | 2 +- Mage.Sets/src/mage/cards/g/GisaAndGeralf.java | 2 +- Mage.Sets/src/mage/cards/g/Gomazoa.java | 2 +- .../src/mage/cards/g/GontisMachinations.java | 2 +- .../src/mage/cards/g/GrandWarlordRadha.java | 4 ++-- Mage.Sets/src/mage/cards/g/GrimReminder.java | 2 +- .../mage/cards/g/GrothamaAllDevouring.java | 2 +- .../src/mage/cards/g/GuildmagesForum.java | 2 +- .../src/mage/cards/h/HallOfTheBanditLord.java | 2 +- .../mage/cards/h/HomicidalBruteWatcher.java | 2 +- .../src/mage/cards/h/HopeOfGhirapur.java | 10 ++++----- .../src/mage/cards/h/HotheadedGiant.java | 2 +- Mage.Sets/src/mage/cards/i/IcefallRegent.java | 2 +- .../src/mage/cards/i/IchneumonDruid.java | 2 +- .../src/mage/cards/i/ImpactResonance.java | 2 +- Mage.Sets/src/mage/cards/i/InfernoTrap.java | 4 ++-- .../src/mage/cards/i/InsatiableRakghoul.java | 2 +- Mage.Sets/src/mage/cards/i/Insist.java | 2 +- Mage.Sets/src/mage/cards/j/JandorsRing.java | 6 ++--- .../mage/cards/j/JelevaNephaliasScourge.java | 2 +- .../mage/cards/k/KaradorGhostChieftain.java | 4 ++-- .../src/mage/cards/k/KessDissidentMage.java | 2 +- .../mage/cards/k/KnightsOfTheBlackRose.java | 2 +- .../src/mage/cards/k/KrovikanVampire.java | 10 ++++----- .../src/mage/cards/k/KumanosBlessing.java | 2 +- .../mage/cards/k/KydeleChosenOfKruphix.java | 2 +- Mage.Sets/src/mage/cards/m/ManaMaze.java | 14 +++++++----- .../src/mage/cards/m/MasterWarcraft.java | 2 +- .../src/mage/cards/m/MindstormCrown.java | 2 +- Mage.Sets/src/mage/cards/m/MoltenPsyche.java | 2 +- .../mage/cards/m/MuldrothaTheGravetide.java | 4 ++-- .../src/mage/cards/m/MultanisPresence.java | 10 ++++----- .../src/mage/cards/n/NoRestForTheWicked.java | 10 ++++++--- Mage.Sets/src/mage/cards/o/OathOfChandra.java | 2 +- Mage.Sets/src/mage/cards/o/OathOfLiliana.java | 2 +- Mage.Sets/src/mage/cards/o/OpalPalace.java | 2 +- Mage.Sets/src/mage/cards/o/Overmaster.java | 2 +- .../mage/cards/p/PalladiaMorsTheRuiner.java | 2 +- .../src/mage/cards/p/PatriciansScorn.java | 2 +- .../src/mage/cards/p/PetrifiedWoodKin.java | 5 +++-- Mage.Sets/src/mage/cards/p/PowerSurge.java | 2 +- .../src/mage/cards/p/PredatoryAdvantage.java | 2 +- .../src/mage/cards/p/PrematureBurial.java | 2 +- Mage.Sets/src/mage/cards/q/Quicken.java | 2 +- .../src/mage/cards/r/RasputinDreamweaver.java | 2 +- .../src/mage/cards/r/ReversePolarity.java | 2 +- .../src/mage/cards/r/RocketLauncher.java | 14 +++++++----- .../src/mage/cards/s/SavageSummoning.java | 2 +- Mage.Sets/src/mage/cards/s/ScoutsWarning.java | 2 +- Mage.Sets/src/mage/cards/s/SeaTroll.java | 2 +- .../src/mage/cards/s/SeasonOfTheWitch.java | 4 ++-- Mage.Sets/src/mage/cards/s/SecondSunrise.java | 10 ++++++--- Mage.Sets/src/mage/cards/s/SentinelTower.java | 2 +- .../src/mage/cards/s/ShapeOfTheWiitigo.java | 2 +- .../src/mage/cards/s/ShipbreakerKraken.java | 2 +- .../src/mage/cards/s/SiftThroughSands.java | 2 +- Mage.Sets/src/mage/cards/s/SoulReap.java | 2 +- .../src/mage/cards/s/SpinerockKnoll.java | 2 +- Mage.Sets/src/mage/cards/s/SpinyStarfish.java | 2 +- .../mage/cards/s/SpiritOfTheLabyrinth.java | 2 +- Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java | 10 ++++++--- Mage.Sets/src/mage/cards/s/SteelHellkite.java | 2 +- Mage.Sets/src/mage/cards/s/SummoningTrap.java | 4 ++-- Mage.Sets/src/mage/cards/s/SylvanLibrary.java | 2 +- .../src/mage/cards/t/TalarasBattalion.java | 2 +- .../src/mage/cards/t/TapestryOfTheAges.java | 4 ++-- .../src/mage/cards/t/TerritorialHellkite.java | 2 +- Mage.Sets/src/mage/cards/t/TheChainVeil.java | 2 +- Mage.Sets/src/mage/cards/t/TheFallen.java | 2 +- Mage.Sets/src/mage/cards/t/ThirstingAxe.java | 5 ++--- .../src/mage/cards/t/ThousandYearStorm.java | 2 +- .../src/mage/cards/t/TidebinderMage.java | 2 +- Mage.Sets/src/mage/cards/t/TimeOfIce.java | 2 +- Mage.Sets/src/mage/cards/t/TimeToReflect.java | 2 +- Mage.Sets/src/mage/cards/t/TritonTactics.java | 2 +- Mage.Sets/src/mage/cards/t/TunnelIgnus.java | 2 +- .../src/mage/cards/t/TuvasaTheSunlit.java | 2 +- .../src/mage/cards/t/TymnaTheWeaver.java | 2 +- Mage.Sets/src/mage/cards/u/UbaMask.java | 2 +- Mage.Sets/src/mage/cards/u/UphillBattle.java | 6 ++--- Mage.Sets/src/mage/cards/u/UrzasMiter.java | 2 +- .../src/mage/cards/v/VeneratedLoxodon.java | 2 +- Mage.Sets/src/mage/cards/v/Vengevine.java | 4 ++-- Mage.Sets/src/mage/cards/v/VileRedeemer.java | 2 +- .../src/mage/cards/v/VizierOfManyFaces.java | 2 +- .../src/mage/cards/v/VodalianWarMachine.java | 2 +- .../src/mage/cards/w/WhisperingSnitch.java | 2 +- Mage.Sets/src/mage/cards/w/Wiitigo.java | 2 +- Mage.Sets/src/mage/cards/w/WookieeMystic.java | 2 +- .../mage/abilities/keyword/ExertAbility.java | 2 +- .../mage/abilities/keyword/MeleeAbility.java | 10 ++++----- Mage/src/main/java/mage/watchers/Watcher.java | 22 +++++++++---------- ...fDamageAPlayerReceivedThisTurnWatcher.java | 2 +- .../common/AttackedLastTurnWatcher.java | 2 +- .../AttackedOrBlockedThisCombatWatcher.java | 16 +++++++------- .../common/AttackedThisTurnWatcher.java | 6 ++--- .../common/BlockedAttackerWatcher.java | 5 +++-- ...kedByOnlyOneCreatureThisCombatWatcher.java | 2 +- .../common/BlockedThisTurnWatcher.java | 2 +- .../watchers/common/BloodthirstWatcher.java | 2 +- .../CardsAmountDrawnThisTurnWatcher.java | 2 +- ...CardsCycledOrDiscardedThisTurnWatcher.java | 2 +- .../CardsDrawnDuringDrawStepWatcher.java | 2 +- .../common/CardsPutIntoGraveyardWatcher.java | 2 +- .../common/CastFromGraveyardWatcher.java | 2 +- .../watchers/common/CastFromHandWatcher.java | 2 +- .../common/CastSpellLastTurnWatcher.java | 2 +- .../common/CastSpellYourLastTurnWatcher.java | 2 +- .../ChooseBlockersRedundancyWatcher.java | 2 +- .../watchers/common/CommanderInfoWatcher.java | 6 ++--- .../CreatureAttackedWhichPlayerWatcher.java | 2 +- .../common/CreatureWasCastWatcher.java | 2 +- .../watchers/common/CreaturesDiedWatcher.java | 7 +++--- .../watchers/common/DamageDoneWatcher.java | 16 ++++++++++---- .../watchers/common/DamagedByWatcher.java | 2 +- ...heBattlefieldWhileSpellWasCastWatcher.java | 2 +- .../common/FirstSpellCastThisTurnWatcher.java | 2 +- .../watchers/common/FirstTimeStepWatcher.java | 7 +++++- .../watchers/common/GravestormWatcher.java | 2 +- .../mage/watchers/common/LandfallWatcher.java | 8 +++---- .../LifeLossOtherFromCombatWatcher.java | 2 +- .../common/ManaSpentToCastWatcher.java | 4 ++-- .../mage/watchers/common/MiracleWatcher.java | 2 +- .../mage/watchers/common/MorbidWatcher.java | 2 +- ...rOfTimesPermanentTargetedATurnWatcher.java | 2 +- .../PermanentsEnteredBattlefieldWatcher.java | 12 +++++----- ...EnteredBattlefieldYourLastTurnWatcher.java | 11 ++++------ .../common/PermanentsSacrificedWatcher.java | 10 ++++----- .../watchers/common/PlanarRollWatcher.java | 2 +- .../mage/watchers/common/PlayLandWatcher.java | 6 ++--- .../common/PlayerAttackedStepWatcher.java | 2 +- .../common/PlayerAttackedWatcher.java | 2 +- .../common/PlayerCastCreatureWatcher.java | 12 +++++----- .../common/PlayerDamagedBySourceWatcher.java | 2 +- .../common/PlayerGainedLifeWatcher.java | 2 +- .../PlayerLostLifeNonCombatWatcher.java | 2 +- .../common/PlayerLostLifeWatcher.java | 2 +- .../PlayersAttackedLastTurnWatcher.java | 2 +- .../PlayersAttackedThisTurnWatcher.java | 2 +- .../mage/watchers/common/ProwlWatcher.java | 4 ++-- .../mage/watchers/common/RevoltWatcher.java | 2 +- .../common/SourceDidDamageWatcher.java | 2 +- .../watchers/common/SpellsCastWatcher.java | 10 ++++----- .../common/WasBlockedThisTurnWatcher.java | 4 ++-- .../watchers/common/ZuberasDiedWatcher.java | 2 +- 178 files changed, 313 insertions(+), 296 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java b/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java index 263dd0d8ab..e66954c891 100644 --- a/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java +++ b/Mage.Sets/src/mage/cards/a/AbandonedSarcophagus.java @@ -135,7 +135,7 @@ class AbandonedSarcophagusWatcher extends Watcher { private final Map cycledCardsThisTurn = new HashMap<>(); AbandonedSarcophagusWatcher() { - super(AbandonedSarcophagusWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } private AbandonedSarcophagusWatcher(final AbandonedSarcophagusWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java b/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java index 0d675b09f2..8f3a011dcf 100644 --- a/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java +++ b/Mage.Sets/src/mage/cards/a/AdmiralBeckettBrass.java @@ -71,7 +71,7 @@ class DamagedByPiratesWatcher extends Watcher { private final Map> damageSourceIds = new HashMap<>(); public DamagedByPiratesWatcher() { - super(DamagedByPiratesWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } private DamagedByPiratesWatcher(final DamagedByPiratesWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/a/ApproachOfTheSecondSun.java b/Mage.Sets/src/mage/cards/a/ApproachOfTheSecondSun.java index 235118e8b3..76cf887d40 100644 --- a/Mage.Sets/src/mage/cards/a/ApproachOfTheSecondSun.java +++ b/Mage.Sets/src/mage/cards/a/ApproachOfTheSecondSun.java @@ -96,7 +96,7 @@ class ApproachOfTheSecondSunWatcher extends Watcher { private Map approachesCast = new HashMap<>(); public ApproachOfTheSecondSunWatcher() { - super(ApproachOfTheSecondSunWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public ApproachOfTheSecondSunWatcher(final ApproachOfTheSecondSunWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/a/ArchiveTrap.java b/Mage.Sets/src/mage/cards/a/ArchiveTrap.java index 0be35df652..ead89d87a5 100644 --- a/Mage.Sets/src/mage/cards/a/ArchiveTrap.java +++ b/Mage.Sets/src/mage/cards/a/ArchiveTrap.java @@ -54,7 +54,7 @@ class ArchiveTrapWatcher extends Watcher { private Set playerIds = new HashSet<>(); public ArchiveTrapWatcher() { - super(ArchiveTrapWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } private ArchiveTrapWatcher(final ArchiveTrapWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java b/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java index 8301cc88c2..5cb55edbc2 100644 --- a/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java +++ b/Mage.Sets/src/mage/cards/a/ArclightPhoenix.java @@ -84,7 +84,7 @@ class ArclightPhoenixWatcher extends Watcher { private final Map instantSorceryCount = new HashMap<>(); public ArclightPhoenixWatcher() { - super(ArclightPhoenixWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public ArclightPhoenixWatcher(final ArclightPhoenixWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java b/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java index 7fa11e1473..ee45b419a1 100644 --- a/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java +++ b/Mage.Sets/src/mage/cards/a/AsmiraHolyAvenger.java @@ -56,7 +56,7 @@ class AsmiraHolyAvengerWatcher extends Watcher { private int creaturesCount = 0; public AsmiraHolyAvengerWatcher() { - super(AsmiraHolyAvengerWatcher.class.getSimpleName(), WatcherScope.PLAYER); + super(WatcherScope.PLAYER); condition = true; } diff --git a/Mage.Sets/src/mage/cards/a/AureliasFury.java b/Mage.Sets/src/mage/cards/a/AureliasFury.java index 01d4800511..634de83e29 100644 --- a/Mage.Sets/src/mage/cards/a/AureliasFury.java +++ b/Mage.Sets/src/mage/cards/a/AureliasFury.java @@ -172,7 +172,7 @@ class AureliasFuryDamagedByWatcher extends Watcher { private final Set damagedPlayers = new HashSet<>(); AureliasFuryDamagedByWatcher() { - super(AureliasFuryDamagedByWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); } private AureliasFuryDamagedByWatcher(final AureliasFuryDamagedByWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/b/Berserk.java b/Mage.Sets/src/mage/cards/b/Berserk.java index d1f990e57e..4a5cbc6440 100644 --- a/Mage.Sets/src/mage/cards/b/Berserk.java +++ b/Mage.Sets/src/mage/cards/b/Berserk.java @@ -96,7 +96,7 @@ class BerserkReplacementEffect extends ContinuousRuleModifyingEffectImpl { class CombatDamageStepStartedWatcher extends Watcher { public CombatDamageStepStartedWatcher() { - super(CombatDamageStepStartedWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public CombatDamageStepStartedWatcher(final CombatDamageStepStartedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/b/BlazingEffigy.java b/Mage.Sets/src/mage/cards/b/BlazingEffigy.java index 6ef735f7ee..b61c69b42c 100644 --- a/Mage.Sets/src/mage/cards/b/BlazingEffigy.java +++ b/Mage.Sets/src/mage/cards/b/BlazingEffigy.java @@ -81,10 +81,10 @@ enum BlazingEffigyCount implements DynamicValue { class BlazingEffigyWatcher extends Watcher { - public final Map damagedObjects = new HashMap<>(); + private final Map damagedObjects = new HashMap<>(); public BlazingEffigyWatcher() { - super(BlazingEffigyWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public BlazingEffigyWatcher(final BlazingEffigyWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java b/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java index 15c1b4f486..5a8195beb8 100644 --- a/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java +++ b/Mage.Sets/src/mage/cards/b/BoseijuWhoSheltersAll.java @@ -62,7 +62,7 @@ class BoseijuWhoSheltersAllWatcher extends Watcher { private final String originalId; public BoseijuWhoSheltersAllWatcher(UUID originalId) { - super(BoseijuWhoSheltersAllWatcher.class, WatcherScope.CARD); + super(WatcherScope.CARD); this.originalId = originalId.toString(); } diff --git a/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java b/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java index ec620a455e..6cda9d99ce 100644 --- a/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java +++ b/Mage.Sets/src/mage/cards/b/BurningCinderFuryOfCrimsonChaosFire.java @@ -201,7 +201,7 @@ class BurningCinderFuryOfCrimsonChaosFireWatcher extends Watcher { private final Set tappedActivePlayerIds = new HashSet<>(); public BurningCinderFuryOfCrimsonChaosFireWatcher() { - super(BurningCinderFuryOfCrimsonChaosFireWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public BurningCinderFuryOfCrimsonChaosFireWatcher(final BurningCinderFuryOfCrimsonChaosFireWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java b/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java index 1a36673626..fc0c0aee3f 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfTheClaw.java @@ -60,7 +60,7 @@ class CallerOfTheClawWatcher extends Watcher { private int creaturesCount = 0; public CallerOfTheClawWatcher() { - super(CallerOfTheClawWatcher.class.getSimpleName(), WatcherScope.PLAYER); + super(WatcherScope.PLAYER); condition = true; } diff --git a/Mage.Sets/src/mage/cards/c/CathedralMembrane.java b/Mage.Sets/src/mage/cards/c/CathedralMembrane.java index c68b249095..80ce89d1f8 100644 --- a/Mage.Sets/src/mage/cards/c/CathedralMembrane.java +++ b/Mage.Sets/src/mage/cards/c/CathedralMembrane.java @@ -111,7 +111,7 @@ class CathedralMembraneWatcher extends Watcher { private final Set blockedCreatures = new HashSet<>(); CathedralMembraneWatcher() { - super(CathedralMembraneWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); } private CathedralMembraneWatcher(final CathedralMembraneWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/c/CavernOfSouls.java b/Mage.Sets/src/mage/cards/c/CavernOfSouls.java index 57d0c4482e..0cb6fdf728 100644 --- a/Mage.Sets/src/mage/cards/c/CavernOfSouls.java +++ b/Mage.Sets/src/mage/cards/c/CavernOfSouls.java @@ -125,7 +125,7 @@ class CavernOfSoulsWatcher extends Watcher { private final String originalId; public CavernOfSoulsWatcher(UUID originalId) { - super(CavernOfSoulsWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); this.originalId = originalId.toString(); } diff --git a/Mage.Sets/src/mage/cards/c/CerebralVortex.java b/Mage.Sets/src/mage/cards/c/CerebralVortex.java index eca4f82e04..1329470ef8 100644 --- a/Mage.Sets/src/mage/cards/c/CerebralVortex.java +++ b/Mage.Sets/src/mage/cards/c/CerebralVortex.java @@ -81,7 +81,7 @@ class CerebralVortexWatcher extends Watcher { private final Map draws = new HashMap<>(); CerebralVortexWatcher() { - super(CerebralVortexWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } CerebralVortexWatcher(final CerebralVortexWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/c/CobraTrap.java b/Mage.Sets/src/mage/cards/c/CobraTrap.java index 6845197a35..69b1011f58 100644 --- a/Mage.Sets/src/mage/cards/c/CobraTrap.java +++ b/Mage.Sets/src/mage/cards/c/CobraTrap.java @@ -68,10 +68,10 @@ enum CobraTrapCondition implements Condition { class CobraTrapWatcher extends Watcher { - Set players = new HashSet<>(); + private Set players = new HashSet<>(); public CobraTrapWatcher() { - super(CobraTrapWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CobraTrapWatcher(final CobraTrapWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java b/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java index 9709c1754c..b5f0b3842a 100644 --- a/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java +++ b/Mage.Sets/src/mage/cards/c/ConduitOfRuin.java @@ -74,7 +74,7 @@ class ConduitOfRuinWatcher extends Watcher { private Map playerCreatureSpells; public ConduitOfRuinWatcher() { - super(ConduitOfRuinWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); playerCreatureSpells = new HashMap<>(); } diff --git a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java index d33404a545..c1965a1d60 100644 --- a/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java +++ b/Mage.Sets/src/mage/cards/c/CorrosiveOoze.java @@ -122,7 +122,7 @@ class CorrosiveOozeCombatWatcher extends Watcher { private final Map> oozeEquipmentsToDestroy = new HashMap<>(); public CorrosiveOozeCombatWatcher() { - super(CorrosiveOozeCombatWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CorrosiveOozeCombatWatcher(final CorrosiveOozeCombatWatcher watcher) { @@ -132,7 +132,7 @@ class CorrosiveOozeCombatWatcher extends Watcher { oozeBlocksOrBlocked.put(entry.getKey(), newSet); } for (Map.Entry> entry : watcher.oozeEquipmentsToDestroy.entrySet()) { - HashSet newSet = new HashSet<>(entry.getValue()); + Set newSet = new HashSet<>(entry.getValue()); oozeEquipmentsToDestroy.put(entry.getKey(), newSet); } } diff --git a/Mage.Sets/src/mage/cards/c/CustodiSoulcaller.java b/Mage.Sets/src/mage/cards/c/CustodiSoulcaller.java index 95ec6d8866..b8950d773c 100644 --- a/Mage.Sets/src/mage/cards/c/CustodiSoulcaller.java +++ b/Mage.Sets/src/mage/cards/c/CustodiSoulcaller.java @@ -25,10 +25,7 @@ import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetadjustment.TargetAdjuster; import mage.watchers.Watcher; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; +import java.util.*; /** * @author L_J @@ -83,10 +80,10 @@ enum CustodiSoulcallerAdjuster implements TargetAdjuster { class CustodiSoulcallerWatcher extends Watcher { - private final HashMap> playersAttacked = new HashMap<>(0); + private final Map> playersAttacked = new HashMap<>(0); CustodiSoulcallerWatcher() { - super("CustodiSoulcallerWatcher", WatcherScope.GAME); + super(WatcherScope.GAME); } CustodiSoulcallerWatcher(final CustodiSoulcallerWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java b/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java index b548a8db00..d572a307b3 100644 --- a/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java +++ b/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java @@ -190,7 +190,7 @@ class CyclopeanTombCounterWatcher extends Watcher { private final Map> counterData = new HashMap<>(); CyclopeanTombCounterWatcher() { - super(CyclopeanTombCounterWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } private CyclopeanTombCounterWatcher(final CyclopeanTombCounterWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/d/DarkbladeAgent.java b/Mage.Sets/src/mage/cards/d/DarkbladeAgent.java index f87221674b..8af32ccef8 100644 --- a/Mage.Sets/src/mage/cards/d/DarkbladeAgent.java +++ b/Mage.Sets/src/mage/cards/d/DarkbladeAgent.java @@ -85,7 +85,7 @@ class DarkbladeAgentWatcher extends Watcher { private final Set surveiledThisTurn = new HashSet<>(); public DarkbladeAgentWatcher() { - super(DarkbladeAgentWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public DarkbladeAgentWatcher(final DarkbladeAgentWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/d/Desolation.java b/Mage.Sets/src/mage/cards/d/Desolation.java index 89418192ea..27824d61c0 100644 --- a/Mage.Sets/src/mage/cards/d/Desolation.java +++ b/Mage.Sets/src/mage/cards/d/Desolation.java @@ -106,7 +106,7 @@ class DesolationWatcher extends Watcher { private final Set tappedForManaThisTurnPlayers = new HashSet<>(); public DesolationWatcher() { - super(DesolationWatcher.class.getSimpleName(), WatcherScope.GAME); + super( WatcherScope.GAME); } public DesolationWatcher(final DesolationWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/d/DiseasedVermin.java b/Mage.Sets/src/mage/cards/d/DiseasedVermin.java index d7074ed774..e4c8c5108a 100644 --- a/Mage.Sets/src/mage/cards/d/DiseasedVermin.java +++ b/Mage.Sets/src/mage/cards/d/DiseasedVermin.java @@ -137,7 +137,7 @@ class DiseasedVerminWatcher extends Watcher { private final Set damagedPlayers; public DiseasedVerminWatcher() { - super(DiseasedVerminWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); damagedPlayers = new HashSet<>(); } diff --git a/Mage.Sets/src/mage/cards/d/DreamSalvage.java b/Mage.Sets/src/mage/cards/d/DreamSalvage.java index 6d8ad465fc..df6fe89ffc 100644 --- a/Mage.Sets/src/mage/cards/d/DreamSalvage.java +++ b/Mage.Sets/src/mage/cards/d/DreamSalvage.java @@ -49,7 +49,7 @@ class CardsDiscardedThisTurnWatcher extends Watcher { private final Map amountOfCardsDiscardedThisTurn = new HashMap<>(); public CardsDiscardedThisTurnWatcher() { - super(CardsDiscardedThisTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public CardsDiscardedThisTurnWatcher(final CardsDiscardedThisTurnWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/d/DungeonGeists.java b/Mage.Sets/src/mage/cards/d/DungeonGeists.java index ca1adb9746..fe37bde78b 100644 --- a/Mage.Sets/src/mage/cards/d/DungeonGeists.java +++ b/Mage.Sets/src/mage/cards/d/DungeonGeists.java @@ -131,7 +131,7 @@ class DungeonGeistsEffect extends ContinuousRuleModifyingEffectImpl { class DungeonGeistsWatcher extends Watcher { DungeonGeistsWatcher() { - super("ControlLost", WatcherScope.CARD); + super(WatcherScope.CARD); } DungeonGeistsWatcher(DungeonGeistsWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java b/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java index c303a87b82..048335a056 100644 --- a/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java +++ b/Mage.Sets/src/mage/cards/e/ErdwalIlluminator.java @@ -86,7 +86,7 @@ class InvestigatedWatcher extends Watcher { private final Map timesInvestigated = new HashMap<>(); public InvestigatedWatcher() { - super(InvestigatedWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public InvestigatedWatcher(final InvestigatedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java b/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java index 754304f2e4..9cfb604d03 100644 --- a/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java +++ b/Mage.Sets/src/mage/cards/e/EtherswornCanonist.java @@ -51,7 +51,7 @@ class EtherswornCanonistWatcher extends Watcher { private Set castNonartifactSpell = new HashSet<>(); public EtherswornCanonistWatcher() { - super(EtherswornCanonistWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public EtherswornCanonistWatcher(final EtherswornCanonistWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java b/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java index da246d4624..1ae545be10 100644 --- a/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java +++ b/Mage.Sets/src/mage/cards/f/FairgroundsTrumpeter.java @@ -73,7 +73,7 @@ class FairgroundsTrumpeterWatcher extends Watcher { private final Set players = new HashSet<>(); public FairgroundsTrumpeterWatcher() { - super(FairgroundsTrumpeterWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public FairgroundsTrumpeterWatcher(final FairgroundsTrumpeterWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/f/FaithsReward.java b/Mage.Sets/src/mage/cards/f/FaithsReward.java index 5c46a5e563..17121aa83c 100644 --- a/Mage.Sets/src/mage/cards/f/FaithsReward.java +++ b/Mage.Sets/src/mage/cards/f/FaithsReward.java @@ -80,7 +80,7 @@ class FaithsRewardWatcher extends Watcher { private List cards = new ArrayList<>(); public FaithsRewardWatcher() { - super(FaithsRewardWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public FaithsRewardWatcher(final FaithsRewardWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/f/FellShepherd.java b/Mage.Sets/src/mage/cards/f/FellShepherd.java index 44f9007fe6..6e2e833391 100644 --- a/Mage.Sets/src/mage/cards/f/FellShepherd.java +++ b/Mage.Sets/src/mage/cards/f/FellShepherd.java @@ -65,7 +65,7 @@ class FellShepherdWatcher extends Watcher { private Set creatureIds = new HashSet<>(); public FellShepherdWatcher() { - super(FellShepherdWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); condition = true; } diff --git a/Mage.Sets/src/mage/cards/f/FleshAllergy.java b/Mage.Sets/src/mage/cards/f/FleshAllergy.java index b14d2f10ee..1ea3c3d811 100644 --- a/Mage.Sets/src/mage/cards/f/FleshAllergy.java +++ b/Mage.Sets/src/mage/cards/f/FleshAllergy.java @@ -57,7 +57,7 @@ class FleshAllergyWatcher extends Watcher { private int creaturesDiedThisTurn = 0; public FleshAllergyWatcher() { - super(FleshAllergyWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } private FleshAllergyWatcher(final FleshAllergyWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/f/FreeRangeChicken.java b/Mage.Sets/src/mage/cards/f/FreeRangeChicken.java index 2bc8ed23a3..44fa863213 100644 --- a/Mage.Sets/src/mage/cards/f/FreeRangeChicken.java +++ b/Mage.Sets/src/mage/cards/f/FreeRangeChicken.java @@ -98,7 +98,7 @@ class FreeRangeChickenWatcher extends Watcher { private final Map totalRolls = new HashMap<>(); public FreeRangeChickenWatcher() { - super(FreeRangeChickenWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public FreeRangeChickenWatcher(final FreeRangeChickenWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java index 45dbfaa66c..2583df059c 100644 --- a/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java +++ b/Mage.Sets/src/mage/cards/g/GarnaTheBloodflame.java @@ -109,7 +109,7 @@ class GarnaTheBloodflameWatcher extends Watcher { private final Set cards = new HashSet<>(); public GarnaTheBloodflameWatcher() { - super(GarnaTheBloodflameWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public GarnaTheBloodflameWatcher(final GarnaTheBloodflameWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GeneratorServant.java b/Mage.Sets/src/mage/cards/g/GeneratorServant.java index 144f828056..1cf33279df 100644 --- a/Mage.Sets/src/mage/cards/g/GeneratorServant.java +++ b/Mage.Sets/src/mage/cards/g/GeneratorServant.java @@ -63,7 +63,7 @@ class GeneratorServantWatcher extends Watcher { private List creatures = new ArrayList<>(); public GeneratorServantWatcher() { - super(GeneratorServantWatcher.class, WatcherScope.CARD); + super(WatcherScope.CARD); } private GeneratorServantWatcher(final GeneratorServantWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java b/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java index 9adc4c9268..b0080c17d2 100644 --- a/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java +++ b/Mage.Sets/src/mage/cards/g/GisaAndGeralf.java @@ -133,7 +133,7 @@ class GisaAndGeralfWatcher extends Watcher { private boolean abilityUsed = false; GisaAndGeralfWatcher() { - super("GisaAndGeralfWatcher", WatcherScope.CARD); + super(WatcherScope.CARD); } GisaAndGeralfWatcher(final GisaAndGeralfWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/Gomazoa.java b/Mage.Sets/src/mage/cards/g/Gomazoa.java index b3163a4fda..fb217b8627 100644 --- a/Mage.Sets/src/mage/cards/g/Gomazoa.java +++ b/Mage.Sets/src/mage/cards/g/Gomazoa.java @@ -120,7 +120,7 @@ class BlockedByWatcher extends Watcher { private List blockedByWatcher = new ArrayList<>(); public BlockedByWatcher() { - super(BlockedByWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); } private BlockedByWatcher(final BlockedByWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GontisMachinations.java b/Mage.Sets/src/mage/cards/g/GontisMachinations.java index c4d58174c8..c69a3692b4 100644 --- a/Mage.Sets/src/mage/cards/g/GontisMachinations.java +++ b/Mage.Sets/src/mage/cards/g/GontisMachinations.java @@ -97,7 +97,7 @@ class GontisMachinationsFirstLostLifeThisTurnWatcher extends Watcher { private final Map playersLostLife = new HashMap<>(); public GontisMachinationsFirstLostLifeThisTurnWatcher() { - super(GontisMachinationsFirstLostLifeThisTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public GontisMachinationsFirstLostLifeThisTurnWatcher(final GontisMachinationsFirstLostLifeThisTurnWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java b/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java index 5f06e04c4f..9eefb0a7f1 100644 --- a/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java +++ b/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java @@ -62,10 +62,10 @@ public final class GrandWarlordRadha extends CardImpl { class CreaturesAttackedWatcher extends Watcher { - public final Set attackedThisTurnCreatures = new HashSet<>(); + private final Set attackedThisTurnCreatures = new HashSet<>(); public CreaturesAttackedWatcher() { - super(CreaturesAttackedWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public CreaturesAttackedWatcher(final CreaturesAttackedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GrimReminder.java b/Mage.Sets/src/mage/cards/g/GrimReminder.java index d25a47eed4..828cc12edd 100644 --- a/Mage.Sets/src/mage/cards/g/GrimReminder.java +++ b/Mage.Sets/src/mage/cards/g/GrimReminder.java @@ -116,7 +116,7 @@ class GrimReminderWatcher extends Watcher { private final Map> playersCastSpell = new HashMap<>(); public GrimReminderWatcher() { - super(GrimReminderWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public GrimReminderWatcher(final GrimReminderWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java b/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java index 77832fe2e0..21997da89a 100644 --- a/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java +++ b/Mage.Sets/src/mage/cards/g/GrothamaAllDevouring.java @@ -171,7 +171,7 @@ class GrothamaAllDevouringWatcher extends Watcher { private Map> damageMap = new HashMap<>(); GrothamaAllDevouringWatcher() { - super(GrothamaAllDevouringWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } GrothamaAllDevouringWatcher(final GrothamaAllDevouringWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/g/GuildmagesForum.java b/Mage.Sets/src/mage/cards/g/GuildmagesForum.java index e87d34e10d..f13e1700f9 100644 --- a/Mage.Sets/src/mage/cards/g/GuildmagesForum.java +++ b/Mage.Sets/src/mage/cards/g/GuildmagesForum.java @@ -58,7 +58,7 @@ class GuildmagesForumWatcher extends Watcher { private final Ability source; GuildmagesForumWatcher(Ability source) { - super("GuildmagesForumWatcher", WatcherScope.CARD); + super(WatcherScope.CARD); this.source = source; } diff --git a/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java b/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java index 3ab7d488b2..067ac1c399 100644 --- a/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java +++ b/Mage.Sets/src/mage/cards/h/HallOfTheBanditLord.java @@ -66,7 +66,7 @@ class HallOfTheBanditLordWatcher extends Watcher { private final List creatures = new ArrayList<>(); HallOfTheBanditLordWatcher(Ability source) { - super("HallOfTheBanditLordWatcher", WatcherScope.CARD); + super(WatcherScope.CARD); this.source = source; } diff --git a/Mage.Sets/src/mage/cards/h/HomicidalBruteWatcher.java b/Mage.Sets/src/mage/cards/h/HomicidalBruteWatcher.java index c92ff72fcd..944a748140 100644 --- a/Mage.Sets/src/mage/cards/h/HomicidalBruteWatcher.java +++ b/Mage.Sets/src/mage/cards/h/HomicidalBruteWatcher.java @@ -8,7 +8,7 @@ import mage.watchers.Watcher; public class HomicidalBruteWatcher extends Watcher { public HomicidalBruteWatcher() { - super(HomicidalBruteWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); } public HomicidalBruteWatcher(final HomicidalBruteWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java index fbc81094ee..c20236e8c1 100644 --- a/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java +++ b/Mage.Sets/src/mage/cards/h/HopeOfGhirapur.java @@ -1,10 +1,8 @@ package mage.cards.h; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; +import java.util.*; + import mage.MageInt; import mage.MageObject; import mage.MageObjectReference; @@ -138,10 +136,10 @@ class HopeOfGhirapurPlayerLostLifePredicate implements ObjectSourcePlayerPredica class HopeOfGhirapurCombatDamageWatcher extends Watcher { - private final HashMap> combatDamagedPlayers = new HashMap<>(); + private final Map> combatDamagedPlayers = new HashMap<>(); public HopeOfGhirapurCombatDamageWatcher() { - super(HopeOfGhirapurCombatDamageWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public HopeOfGhirapurCombatDamageWatcher(final HopeOfGhirapurCombatDamageWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/h/HotheadedGiant.java b/Mage.Sets/src/mage/cards/h/HotheadedGiant.java index d5ac4b036f..e475b41aad 100644 --- a/Mage.Sets/src/mage/cards/h/HotheadedGiant.java +++ b/Mage.Sets/src/mage/cards/h/HotheadedGiant.java @@ -81,7 +81,7 @@ class HotHeadedGiantWatcher extends Watcher { private UUID cardId; public HotHeadedGiantWatcher(UUID cardId) { - super(HotHeadedGiantWatcher.class.getSimpleName(), WatcherScope.PLAYER); + super(WatcherScope.PLAYER); this.cardId = cardId; } diff --git a/Mage.Sets/src/mage/cards/i/IcefallRegent.java b/Mage.Sets/src/mage/cards/i/IcefallRegent.java index 8e21b7bf10..ec71d65553 100644 --- a/Mage.Sets/src/mage/cards/i/IcefallRegent.java +++ b/Mage.Sets/src/mage/cards/i/IcefallRegent.java @@ -143,7 +143,7 @@ class IcefallRegentEffect extends ContinuousRuleModifyingEffectImpl { class IcefallRegentWatcher extends Watcher { IcefallRegentWatcher() { - super("ControlLost", WatcherScope.CARD); + super(WatcherScope.CARD); } IcefallRegentWatcher(IcefallRegentWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/i/IchneumonDruid.java b/Mage.Sets/src/mage/cards/i/IchneumonDruid.java index bb0a6ec05f..0e878b9815 100644 --- a/Mage.Sets/src/mage/cards/i/IchneumonDruid.java +++ b/Mage.Sets/src/mage/cards/i/IchneumonDruid.java @@ -97,7 +97,7 @@ class IchneumonDruidWatcher extends Watcher { private final Map playerInstantCount = new HashMap<>(); public IchneumonDruidWatcher() { - super(IchneumonDruidWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public IchneumonDruidWatcher(final IchneumonDruidWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/i/ImpactResonance.java b/Mage.Sets/src/mage/cards/i/ImpactResonance.java index e917a081d2..2706a61606 100644 --- a/Mage.Sets/src/mage/cards/i/ImpactResonance.java +++ b/Mage.Sets/src/mage/cards/i/ImpactResonance.java @@ -90,7 +90,7 @@ class GreatestAmountOfDamageWatcher extends Watcher { private int damageAmount; public GreatestAmountOfDamageWatcher() { - super(GreatestAmountOfDamageWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public GreatestAmountOfDamageWatcher(final GreatestAmountOfDamageWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/i/InfernoTrap.java b/Mage.Sets/src/mage/cards/i/InfernoTrap.java index f85d962e14..f2fcc17d1c 100644 --- a/Mage.Sets/src/mage/cards/i/InfernoTrap.java +++ b/Mage.Sets/src/mage/cards/i/InfernoTrap.java @@ -69,10 +69,10 @@ enum InfernoTrapCondition implements Condition { class InfernoTrapWatcher extends Watcher { - Map> playerDamagedByCreature = new HashMap<>(); + private Map> playerDamagedByCreature = new HashMap<>(); public InfernoTrapWatcher() { - super(InfernoTrapWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public InfernoTrapWatcher(final InfernoTrapWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java b/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java index f3553aef62..37b3660d76 100644 --- a/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java +++ b/Mage.Sets/src/mage/cards/i/InsatiableRakghoul.java @@ -83,7 +83,7 @@ class InsatiableRakghoulEffect extends OneShotEffect { class NonArtifactCreaturesDiedWatcher extends Watcher { public NonArtifactCreaturesDiedWatcher() { - super(NonArtifactCreaturesDiedWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public NonArtifactCreaturesDiedWatcher(final NonArtifactCreaturesDiedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/i/Insist.java b/Mage.Sets/src/mage/cards/i/Insist.java index 7531dfdccf..8d2f4d559b 100644 --- a/Mage.Sets/src/mage/cards/i/Insist.java +++ b/Mage.Sets/src/mage/cards/i/Insist.java @@ -104,7 +104,7 @@ class InsistWatcher extends Watcher { protected UUID uncounterableSpell; InsistWatcher() { - super(InsistWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); } InsistWatcher(final InsistWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/j/JandorsRing.java b/Mage.Sets/src/mage/cards/j/JandorsRing.java index 4ebfcfcc65..eab1ac4cfb 100644 --- a/Mage.Sets/src/mage/cards/j/JandorsRing.java +++ b/Mage.Sets/src/mage/cards/j/JandorsRing.java @@ -94,10 +94,10 @@ class JandorsRingEffect extends OneShotEffect { class JandorsRingWatcher extends Watcher { - Map lastDrawnCards = new HashMap<>(); + private Map lastDrawnCards = new HashMap<>(); public JandorsRingWatcher() { - super(JandorsRingWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public JandorsRingWatcher(final JandorsRingWatcher watcher) { @@ -137,7 +137,7 @@ enum WatchedCardInHandCondition implements Condition { JandorsRingWatcher watcher = game.getState().getWatcher(JandorsRingWatcher.class); return watcher != null - && watcher.lastDrawnCards != null && game.getPlayer(source.getControllerId()).getHand().contains(watcher.getLastDrewCard(source.getControllerId())); + && game.getPlayer(source.getControllerId()).getHand().contains(watcher.getLastDrewCard(source.getControllerId())); } @Override diff --git a/Mage.Sets/src/mage/cards/j/JelevaNephaliasScourge.java b/Mage.Sets/src/mage/cards/j/JelevaNephaliasScourge.java index 1177abe7f8..4dc59ed8f2 100644 --- a/Mage.Sets/src/mage/cards/j/JelevaNephaliasScourge.java +++ b/Mage.Sets/src/mage/cards/j/JelevaNephaliasScourge.java @@ -144,7 +144,7 @@ class JelevaNephaliasWatcher extends Watcher { private final Map manaSpendToCast = new HashMap<>(); // cast public JelevaNephaliasWatcher() { - super(JelevaNephaliasWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public JelevaNephaliasWatcher(final JelevaNephaliasWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java index 579f1cdb08..f4e4da06eb 100644 --- a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java +++ b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java @@ -163,10 +163,10 @@ class KaradorGhostChieftainCastFromGraveyardEffect extends AsThoughEffectImpl { class KaradorGhostChieftainWatcher extends Watcher { - boolean abilityUsed = false; + private boolean abilityUsed = false; KaradorGhostChieftainWatcher() { - super(KaradorGhostChieftainWatcher.class, WatcherScope.CARD); + super(WatcherScope.CARD); } KaradorGhostChieftainWatcher(final KaradorGhostChieftainWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/k/KessDissidentMage.java b/Mage.Sets/src/mage/cards/k/KessDissidentMage.java index f6a721a0d8..3e4e88f607 100644 --- a/Mage.Sets/src/mage/cards/k/KessDissidentMage.java +++ b/Mage.Sets/src/mage/cards/k/KessDissidentMage.java @@ -159,7 +159,7 @@ class KessDissidentMageWatcher extends Watcher { private final Map castSpells = new HashMap<>(); KessDissidentMageWatcher() { - super(KessDissidentMageWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } private KessDissidentMageWatcher(final KessDissidentMageWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java b/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java index 289dd51feb..7d0f2532e8 100644 --- a/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java +++ b/Mage.Sets/src/mage/cards/k/KnightsOfTheBlackRose.java @@ -105,7 +105,7 @@ class MonarchAtTurnStartWatcher extends Watcher { private UUID monarchIdAtTurnStart; public MonarchAtTurnStartWatcher() { - super(MonarchAtTurnStartWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public MonarchAtTurnStartWatcher(final MonarchAtTurnStartWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/k/KrovikanVampire.java b/Mage.Sets/src/mage/cards/k/KrovikanVampire.java index 9918b14638..22e57a47fe 100644 --- a/Mage.Sets/src/mage/cards/k/KrovikanVampire.java +++ b/Mage.Sets/src/mage/cards/k/KrovikanVampire.java @@ -115,7 +115,7 @@ enum KrovikanVampireInterveningIfCondition implements Condition { KrovikanVampireCreaturesDiedWatcher watcherDied = game.getState().getWatcher(KrovikanVampireCreaturesDiedWatcher.class); KrovikanVampireCreaturesDamagedWatcher watcherDamaged = game.getState().getWatcher(KrovikanVampireCreaturesDamagedWatcher.class); if (watcherDied != null) { - Set creaturesThatDiedThisTurn = watcherDied.diedThisTurn; + Set creaturesThatDiedThisTurn = watcherDied.getDiedThisTurn(); for (UUID mor : creaturesThatDiedThisTurn) { if (watcherDamaged != null) { for (UUID mor2 : watcherDamaged.getDamagedBySource()) { @@ -143,10 +143,10 @@ enum KrovikanVampireInterveningIfCondition implements Condition { class KrovikanVampireCreaturesDamagedWatcher extends Watcher { - public final Set damagedBySource = new HashSet<>(); + private final Set damagedBySource = new HashSet<>(); public KrovikanVampireCreaturesDamagedWatcher() { - super(KrovikanVampireCreaturesDamagedWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public KrovikanVampireCreaturesDamagedWatcher(final KrovikanVampireCreaturesDamagedWatcher watcher) { @@ -179,10 +179,10 @@ class KrovikanVampireCreaturesDamagedWatcher extends Watcher { class KrovikanVampireCreaturesDiedWatcher extends Watcher { - public final Set diedThisTurn = new HashSet<>(); + private final Set diedThisTurn = new HashSet<>(); public KrovikanVampireCreaturesDiedWatcher() { - super(KrovikanVampireCreaturesDiedWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public KrovikanVampireCreaturesDiedWatcher(final KrovikanVampireCreaturesDiedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/k/KumanosBlessing.java b/Mage.Sets/src/mage/cards/k/KumanosBlessing.java index 6c0f1f2d18..675c8c6973 100644 --- a/Mage.Sets/src/mage/cards/k/KumanosBlessing.java +++ b/Mage.Sets/src/mage/cards/k/KumanosBlessing.java @@ -109,7 +109,7 @@ class DamagedByEnchantedWatcher extends Watcher { private final Set damagedCreatures = new HashSet<>(); public DamagedByEnchantedWatcher() { - super(DamagedByEnchantedWatcher.class, WatcherScope.CARD); + super(WatcherScope.CARD); } public DamagedByEnchantedWatcher(final DamagedByEnchantedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/k/KydeleChosenOfKruphix.java b/Mage.Sets/src/mage/cards/k/KydeleChosenOfKruphix.java index 21e19810cd..2bd53139c8 100644 --- a/Mage.Sets/src/mage/cards/k/KydeleChosenOfKruphix.java +++ b/Mage.Sets/src/mage/cards/k/KydeleChosenOfKruphix.java @@ -85,7 +85,7 @@ class KydeleCardsDrawnThisTurnWatcher extends Watcher { private final Map cardsDrawnThisTurn = new HashMap<>(); public KydeleCardsDrawnThisTurnWatcher() { - super(KydeleCardsDrawnThisTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public KydeleCardsDrawnThisTurnWatcher(final KydeleCardsDrawnThisTurnWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/m/ManaMaze.java b/Mage.Sets/src/mage/cards/m/ManaMaze.java index 2ff6f48334..3d3504a2b4 100644 --- a/Mage.Sets/src/mage/cards/m/ManaMaze.java +++ b/Mage.Sets/src/mage/cards/m/ManaMaze.java @@ -64,8 +64,8 @@ class ManaMazeEffect extends ContinuousRuleModifyingEffectImpl { Card card = game.getCard(event.getSourceId()); if (card != null) { LastSpellCastWatcher watcher = game.getState().getWatcher(LastSpellCastWatcher.class); - if (watcher != null && watcher.lastSpellCast != null) { - return !card.getColor(game).intersection(watcher.lastSpellCast.getColor(game)).isColorless(); + if (watcher != null && watcher.getLastSpellCast() != null) { + return !card.getColor(game).intersection(watcher.getLastSpellCast().getColor(game)).isColorless(); } } return false; @@ -84,15 +84,15 @@ class ManaMazeEffect extends ContinuousRuleModifyingEffectImpl { class LastSpellCastWatcher extends Watcher { - Spell lastSpellCast = null; + private Spell lastSpellCast = null; public LastSpellCastWatcher() { - super(LastSpellCastWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public LastSpellCastWatcher(final LastSpellCastWatcher watcher) { super(watcher); - this.lastSpellCast = watcher.lastSpellCast; + this.lastSpellCast = watcher.getLastSpellCast(); } @Override @@ -121,4 +121,8 @@ class LastSpellCastWatcher extends Watcher { super.reset(); lastSpellCast = null; } + + public Spell getLastSpellCast() { + return lastSpellCast; + } } diff --git a/Mage.Sets/src/mage/cards/m/MasterWarcraft.java b/Mage.Sets/src/mage/cards/m/MasterWarcraft.java index ea80d6b2aa..4889ff1da7 100644 --- a/Mage.Sets/src/mage/cards/m/MasterWarcraft.java +++ b/Mage.Sets/src/mage/cards/m/MasterWarcraft.java @@ -254,7 +254,7 @@ class MasterWarcraftCastWatcher extends Watcher { public int copyCountApply = 0; public MasterWarcraftCastWatcher() { - super(MasterWarcraftCastWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public MasterWarcraftCastWatcher(final MasterWarcraftCastWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/m/MindstormCrown.java b/Mage.Sets/src/mage/cards/m/MindstormCrown.java index 7748a50006..1476dbf296 100644 --- a/Mage.Sets/src/mage/cards/m/MindstormCrown.java +++ b/Mage.Sets/src/mage/cards/m/MindstormCrown.java @@ -80,7 +80,7 @@ class MindstormCrownWatcher extends Watcher { private int cardsInHandCount; public MindstormCrownWatcher() { - super(MindstormCrownWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public MindstormCrownWatcher(final MindstormCrownWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/m/MoltenPsyche.java b/Mage.Sets/src/mage/cards/m/MoltenPsyche.java index b2d6e26ee9..b8b6f7f18c 100644 --- a/Mage.Sets/src/mage/cards/m/MoltenPsyche.java +++ b/Mage.Sets/src/mage/cards/m/MoltenPsyche.java @@ -111,7 +111,7 @@ class MoltenPsycheWatcher extends Watcher { private final Map draws = new HashMap<>(); public MoltenPsycheWatcher() { - super(MoltenPsycheWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public MoltenPsycheWatcher(final MoltenPsycheWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java index dcb9f0f3b2..fc55065416 100644 --- a/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java +++ b/Mage.Sets/src/mage/cards/m/MuldrothaTheGravetide.java @@ -112,7 +112,7 @@ class MuldrothaTheGravetideCastFromGraveyardEffect extends AsThoughEffectImpl { */ class MuldrothaTheGravetideWatcher extends Watcher { - final HashMap> sourcePlayedPermanentTypes = new HashMap<>(); // source that played permanent types from graveyard + private final HashMap> sourcePlayedPermanentTypes = new HashMap<>(); // source that played permanent types from graveyard // final HashMap> playerPlayedPermanentTypes = new HashMap<>(); // player that played permanent types from graveyard // 4/27/2018 If multiple effects allow you to play a card from your graveyard, such as those of Gisa and Geralf and Karador, // Ghost Chieftain, you must announce which permission you're using as you begin to play the card. @@ -121,7 +121,7 @@ class MuldrothaTheGravetideWatcher extends Watcher { private Zone fromZone; public MuldrothaTheGravetideWatcher() { - super(MuldrothaTheGravetideWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public MuldrothaTheGravetideWatcher(final MuldrothaTheGravetideWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/m/MultanisPresence.java b/Mage.Sets/src/mage/cards/m/MultanisPresence.java index 01e1214ae8..3000f24d96 100644 --- a/Mage.Sets/src/mage/cards/m/MultanisPresence.java +++ b/Mage.Sets/src/mage/cards/m/MultanisPresence.java @@ -1,10 +1,8 @@ package mage.cards.m; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; + import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; @@ -74,10 +72,10 @@ class MultanisPresenceTriggeredAbility extends TriggeredAbilityImpl { class MultanisPresenceWatcher extends Watcher { - private final HashMap> spellsCast = new HashMap<>(); + private final Map> spellsCast = new HashMap<>(); public MultanisPresenceWatcher() { - super(MultanisPresenceWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public MultanisPresenceWatcher(final MultanisPresenceWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java b/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java index b07ceb984f..0b0ceb3c9b 100644 --- a/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java +++ b/Mage.Sets/src/mage/cards/n/NoRestForTheWicked.java @@ -62,7 +62,7 @@ class NoRestForTheWickedEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (watcher != null && controller != null) { Cards cardsToHand = new CardsImpl(); - for (UUID cardId : watcher.cards) { + for (UUID cardId : watcher.getCards()) { Card c = game.getCard(cardId); if (c != null) { if (game.getState().getZone(cardId) == Zone.GRAVEYARD @@ -87,10 +87,14 @@ class NoRestForTheWickedEffect extends OneShotEffect { class NoRestForTheWickedWatcher extends Watcher { - List cards; + public List getCards() { + return cards; + } + + private List cards; public NoRestForTheWickedWatcher() { - super(NoRestForTheWickedWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); this.cards = new ArrayList<>(); } diff --git a/Mage.Sets/src/mage/cards/o/OathOfChandra.java b/Mage.Sets/src/mage/cards/o/OathOfChandra.java index b71fc7388a..57f63826f9 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfChandra.java +++ b/Mage.Sets/src/mage/cards/o/OathOfChandra.java @@ -85,7 +85,7 @@ class OathOfChandraWatcher extends Watcher { private final Set players = new HashSet<>(); public OathOfChandraWatcher() { - super(OathOfChandraWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public OathOfChandraWatcher(final OathOfChandraWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java index b8f4691364..d6e81fc775 100644 --- a/Mage.Sets/src/mage/cards/o/OathOfLiliana.java +++ b/Mage.Sets/src/mage/cards/o/OathOfLiliana.java @@ -73,7 +73,7 @@ class OathOfLilianaWatcher extends Watcher { private final Set players = new HashSet<>(); public OathOfLilianaWatcher() { - super(OathOfLilianaWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public OathOfLilianaWatcher(final OathOfLilianaWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/o/OpalPalace.java b/Mage.Sets/src/mage/cards/o/OpalPalace.java index 95f2eb2a79..e010390c4f 100644 --- a/Mage.Sets/src/mage/cards/o/OpalPalace.java +++ b/Mage.Sets/src/mage/cards/o/OpalPalace.java @@ -67,7 +67,7 @@ class OpalPalaceWatcher extends Watcher { private final String originalId; public OpalPalaceWatcher(String originalId) { - super(OpalPalaceWatcher.class, WatcherScope.CARD); + super(WatcherScope.CARD); this.originalId = originalId; } diff --git a/Mage.Sets/src/mage/cards/o/Overmaster.java b/Mage.Sets/src/mage/cards/o/Overmaster.java index fdad1f76ed..1f91bc9841 100644 --- a/Mage.Sets/src/mage/cards/o/Overmaster.java +++ b/Mage.Sets/src/mage/cards/o/Overmaster.java @@ -106,7 +106,7 @@ class OvermasterWatcher extends Watcher { protected UUID uncounterableSpell; OvermasterWatcher() { - super(OvermasterWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); } OvermasterWatcher(final OvermasterWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java b/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java index cafea3387b..f65845133d 100644 --- a/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java +++ b/Mage.Sets/src/mage/cards/p/PalladiaMorsTheRuiner.java @@ -94,7 +94,7 @@ class PalladiaMorsTheRuinerWatcher extends Watcher { private final Set damagers = new HashSet<>(); public PalladiaMorsTheRuinerWatcher() { - super(PalladiaMorsTheRuinerWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public PalladiaMorsTheRuinerWatcher(final PalladiaMorsTheRuinerWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/p/PatriciansScorn.java b/Mage.Sets/src/mage/cards/p/PatriciansScorn.java index 12cecad6c1..c9f0ed7d5f 100644 --- a/Mage.Sets/src/mage/cards/p/PatriciansScorn.java +++ b/Mage.Sets/src/mage/cards/p/PatriciansScorn.java @@ -73,7 +73,7 @@ class PatriciansScornWatcher extends Watcher { } public PatriciansScornWatcher() { - super(PatriciansScornWatcher.class, WatcherScope.CARD); + super(WatcherScope.CARD); } public PatriciansScornWatcher(final PatriciansScornWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/p/PetrifiedWoodKin.java b/Mage.Sets/src/mage/cards/p/PetrifiedWoodKin.java index 7894efcd3f..5ebe0cbb21 100644 --- a/Mage.Sets/src/mage/cards/p/PetrifiedWoodKin.java +++ b/Mage.Sets/src/mage/cards/p/PetrifiedWoodKin.java @@ -2,6 +2,7 @@ package mage.cards.p; import java.util.ArrayList; +import java.util.List; import java.util.UUID; import mage.MageInt; import mage.MageObjectReference; @@ -87,11 +88,11 @@ class PetrifiedWoodKinEffect extends OneShotEffect { if (player == null || watcher == null || permanent == null) { return false; } - 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 int amount = 0; for (UUID opponentId : game.getOpponents(player.getId())) { MageObjectReference mor = new MageObjectReference(opponentId, game); - amount += watcher.damagedObjects.getOrDefault(mor, 0); + amount += watcher.getDamagedObjects().getOrDefault(mor, 0); } permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects); return true; diff --git a/Mage.Sets/src/mage/cards/p/PowerSurge.java b/Mage.Sets/src/mage/cards/p/PowerSurge.java index 7b788da9ef..dd2ee01afd 100644 --- a/Mage.Sets/src/mage/cards/p/PowerSurge.java +++ b/Mage.Sets/src/mage/cards/p/PowerSurge.java @@ -91,7 +91,7 @@ class PowerSurgeWatcher extends Watcher { private int untappedLandCount; public PowerSurgeWatcher() { - super(PowerSurgeWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public PowerSurgeWatcher(final PowerSurgeWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java b/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java index 57906d28fd..8b7bba0c13 100644 --- a/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java +++ b/Mage.Sets/src/mage/cards/p/PredatoryAdvantage.java @@ -65,7 +65,7 @@ class DidNotCastCreatureCondition implements Condition { class CastCreatureWatcher extends Watcher { public CastCreatureWatcher() { - super(CastCreatureWatcher.class, WatcherScope.CARD); + super(WatcherScope.CARD); } public CastCreatureWatcher(final CastCreatureWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/p/PrematureBurial.java b/Mage.Sets/src/mage/cards/p/PrematureBurial.java index b3ebd0759a..a4542bed63 100644 --- a/Mage.Sets/src/mage/cards/p/PrematureBurial.java +++ b/Mage.Sets/src/mage/cards/p/PrematureBurial.java @@ -103,7 +103,7 @@ class ETBSinceYourLastTurnWatcher extends Watcher { private final Map> playerToETBMap; public ETBSinceYourLastTurnWatcher() { - super(ETBSinceYourLastTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); this.playerToETBMap = new HashMap<>(); } diff --git a/Mage.Sets/src/mage/cards/q/Quicken.java b/Mage.Sets/src/mage/cards/q/Quicken.java index 3e9964a01f..3ccc2a178b 100644 --- a/Mage.Sets/src/mage/cards/q/Quicken.java +++ b/Mage.Sets/src/mage/cards/q/Quicken.java @@ -100,7 +100,7 @@ class QuickenWatcher extends Watcher { private List activeQuickenSpells = new ArrayList<>(); public QuickenWatcher() { - super(QuickenWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } private QuickenWatcher(final QuickenWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java b/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java index bfc57f62a7..73f4feebf4 100644 --- a/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java +++ b/Mage.Sets/src/mage/cards/r/RasputinDreamweaver.java @@ -104,7 +104,7 @@ class RasputinDreamweaverStartedUntappedWatcher extends Watcher { private final Set startedUntapped = new HashSet<>(0); RasputinDreamweaverStartedUntappedWatcher() { - super(RasputinDreamweaverStartedUntappedWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } RasputinDreamweaverStartedUntappedWatcher(final RasputinDreamweaverStartedUntappedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/r/ReversePolarity.java b/Mage.Sets/src/mage/cards/r/ReversePolarity.java index ec43bed585..360daa6ed2 100644 --- a/Mage.Sets/src/mage/cards/r/ReversePolarity.java +++ b/Mage.Sets/src/mage/cards/r/ReversePolarity.java @@ -69,7 +69,7 @@ class ReversePolarityWatcher extends Watcher { private final Map artifactDamageReceivedThisTurn = new HashMap<>(); public ReversePolarityWatcher() { - super(ReversePolarityWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public ReversePolarityWatcher(final ReversePolarityWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/r/RocketLauncher.java b/Mage.Sets/src/mage/cards/r/RocketLauncher.java index 7d988810e1..ed0fcbcc7b 100644 --- a/Mage.Sets/src/mage/cards/r/RocketLauncher.java +++ b/Mage.Sets/src/mage/cards/r/RocketLauncher.java @@ -52,18 +52,18 @@ public final class RocketLauncher extends CardImpl { class RocketLauncherWatcher extends Watcher { - boolean changedControllerOR1stTurn; - UUID cardId = null; + private boolean changedControllerOR1stTurn; + private UUID cardId = null; public RocketLauncherWatcher(UUID cardId) { - super(RocketLauncherWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); this.changedControllerOR1stTurn = true; this.cardId = cardId; } public RocketLauncherWatcher(final RocketLauncherWatcher watcher) { super(watcher); - this.changedControllerOR1stTurn = watcher.changedControllerOR1stTurn; + this.changedControllerOR1stTurn = watcher.isChangedControllerOR1stTurn(); this.cardId = watcher.cardId; } @@ -88,6 +88,10 @@ class RocketLauncherWatcher extends Watcher { super.reset(); changedControllerOR1stTurn = true; //when is this reset called? may cause problems if in mid-life } + + public boolean isChangedControllerOR1stTurn() { + return changedControllerOR1stTurn; + } } enum ControlledTurnCondition implements Condition { @@ -99,7 +103,7 @@ enum ControlledTurnCondition implements Condition { public boolean apply(Game game, Ability source) { RocketLauncherWatcher watcher = game.getState().getWatcher(RocketLauncherWatcher.class); - return watcher != null && !watcher.changedControllerOR1stTurn; + return watcher != null && !watcher.isChangedControllerOR1stTurn(); } @Override diff --git a/Mage.Sets/src/mage/cards/s/SavageSummoning.java b/Mage.Sets/src/mage/cards/s/SavageSummoning.java index a5ed8cf4fc..f20f939cf8 100644 --- a/Mage.Sets/src/mage/cards/s/SavageSummoning.java +++ b/Mage.Sets/src/mage/cards/s/SavageSummoning.java @@ -122,7 +122,7 @@ class SavageSummoningWatcher extends Watcher { private Map> cardsCastWithSavageSummoning = new LinkedHashMap<>(); public SavageSummoningWatcher() { - super(SavageSummoningWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); } public SavageSummoningWatcher(final SavageSummoningWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java index 4c9e833db7..0310f8d1f5 100644 --- a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java +++ b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java @@ -101,7 +101,7 @@ class ScoutsWarningWatcher extends Watcher { private List activeScoutsWarningSpells = new ArrayList<>(); public ScoutsWarningWatcher() { - super(ScoutsWarningWatcher.class.getSimpleName(), WatcherScope.PLAYER); + super(WatcherScope.PLAYER); } public ScoutsWarningWatcher(final ScoutsWarningWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SeaTroll.java b/Mage.Sets/src/mage/cards/s/SeaTroll.java index f7fef000ca..2db49072d5 100644 --- a/Mage.Sets/src/mage/cards/s/SeaTroll.java +++ b/Mage.Sets/src/mage/cards/s/SeaTroll.java @@ -58,7 +58,7 @@ class SeaTrollWatcher extends Watcher { private final Set blockedOrBlockedByBlueThisTurnCreatures; public SeaTrollWatcher() { - super(SeaTrollWatcher.class.getSimpleName(), WatcherScope.GAME); + super( WatcherScope.GAME); blockedOrBlockedByBlueThisTurnCreatures = new HashSet<>(); } diff --git a/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java b/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java index 19603497be..f50857d9f2 100644 --- a/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java +++ b/Mage.Sets/src/mage/cards/s/SeasonOfTheWitch.java @@ -109,10 +109,10 @@ class SeasonOfTheWitchEffect extends OneShotEffect { class CouldAttackThisTurnWatcher extends Watcher { - public final Set couldAttackThisTurnCreatures = new HashSet<>(); + private final Set couldAttackThisTurnCreatures = new HashSet<>(); public CouldAttackThisTurnWatcher() { - super(CouldAttackThisTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public CouldAttackThisTurnWatcher(final CouldAttackThisTurnWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SecondSunrise.java b/Mage.Sets/src/mage/cards/s/SecondSunrise.java index bdcc3f29aa..80eab7a411 100644 --- a/Mage.Sets/src/mage/cards/s/SecondSunrise.java +++ b/Mage.Sets/src/mage/cards/s/SecondSunrise.java @@ -59,7 +59,7 @@ class SecondSunriseEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { SecondSunriseWatcher watcher = game.getState().getWatcher(SecondSunriseWatcher.class); if (watcher != null) { - for (UUID id : watcher.cards) { + for (UUID id : watcher.getCards()) { Card c = game.getCard(id); if (c != null && game.getState().getZone(id) == Zone.GRAVEYARD) { if (c.isArtifact() || c.isCreature() || @@ -79,10 +79,10 @@ class SecondSunriseEffect extends OneShotEffect { } class SecondSunriseWatcher extends Watcher { - List cards = new ArrayList<>(); + private List cards = new ArrayList<>(); public SecondSunriseWatcher() { - super(SecondSunriseWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public SecondSunriseWatcher(final SecondSunriseWatcher watcher) { @@ -107,4 +107,8 @@ class SecondSunriseWatcher extends Watcher { super.reset(); cards.clear(); } + + public List getCards(){ + return cards; + } } diff --git a/Mage.Sets/src/mage/cards/s/SentinelTower.java b/Mage.Sets/src/mage/cards/s/SentinelTower.java index a6d9c54336..7b0f0667b1 100644 --- a/Mage.Sets/src/mage/cards/s/SentinelTower.java +++ b/Mage.Sets/src/mage/cards/s/SentinelTower.java @@ -101,7 +101,7 @@ class SentinelTowerWatcher extends Watcher { private final List spellsThisTurn; SentinelTowerWatcher() { - super(SentinelTowerWatcher.class, WatcherScope.GAME); + super( WatcherScope.GAME); this.spellsThisTurn = new ArrayList<>(); } diff --git a/Mage.Sets/src/mage/cards/s/ShapeOfTheWiitigo.java b/Mage.Sets/src/mage/cards/s/ShapeOfTheWiitigo.java index 78de80fc8a..1d2774317e 100644 --- a/Mage.Sets/src/mage/cards/s/ShapeOfTheWiitigo.java +++ b/Mage.Sets/src/mage/cards/s/ShapeOfTheWiitigo.java @@ -95,7 +95,7 @@ class AttackedOrBlockedSinceYourLastUpkeepWatcher extends Watcher{ private final Map> attackedOrBlockedCreatures = new HashMap<>(); public AttackedOrBlockedSinceYourLastUpkeepWatcher() { - super(AttackedOrBlockedSinceYourLastUpkeepWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public AttackedOrBlockedSinceYourLastUpkeepWatcher(AttackedOrBlockedSinceYourLastUpkeepWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java b/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java index d43cfaed03..8fa2848498 100644 --- a/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java +++ b/Mage.Sets/src/mage/cards/s/ShipbreakerKraken.java @@ -121,7 +121,7 @@ class ShipbreakerKrakenReplacementEffect extends ContinuousRuleModifyingEffectIm class ShipbreakerKrakenWatcher extends Watcher { ShipbreakerKrakenWatcher () { - super("ControlLost", WatcherScope.CARD); + super(WatcherScope.CARD); } ShipbreakerKrakenWatcher(ShipbreakerKrakenWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SiftThroughSands.java b/Mage.Sets/src/mage/cards/s/SiftThroughSands.java index 2926888d8d..496d32332f 100644 --- a/Mage.Sets/src/mage/cards/s/SiftThroughSands.java +++ b/Mage.Sets/src/mage/cards/s/SiftThroughSands.java @@ -80,7 +80,7 @@ class SiftThroughSandsWatcher extends Watcher { boolean castReachThroughMists = false; public SiftThroughSandsWatcher() { - super(SiftThroughSandsWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); } public SiftThroughSandsWatcher(final SiftThroughSandsWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SoulReap.java b/Mage.Sets/src/mage/cards/s/SoulReap.java index a128edcf28..d0b9a7d1df 100644 --- a/Mage.Sets/src/mage/cards/s/SoulReap.java +++ b/Mage.Sets/src/mage/cards/s/SoulReap.java @@ -84,7 +84,7 @@ class SoulReapWatcher extends Watcher { private UUID cardId; public SoulReapWatcher(UUID cardId) { - super(SoulReapWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); this.cardId = cardId; } diff --git a/Mage.Sets/src/mage/cards/s/SpinerockKnoll.java b/Mage.Sets/src/mage/cards/s/SpinerockKnoll.java index 04a75201c2..b4f870c9e9 100644 --- a/Mage.Sets/src/mage/cards/s/SpinerockKnoll.java +++ b/Mage.Sets/src/mage/cards/s/SpinerockKnoll.java @@ -91,7 +91,7 @@ class SpinerockKnollWatcher extends Watcher { private final Map amountOfDamageReceivedThisTurn = new HashMap<>(1); SpinerockKnollWatcher() { - super(SpinerockKnollWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); } SpinerockKnollWatcher(final SpinerockKnollWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SpinyStarfish.java b/Mage.Sets/src/mage/cards/s/SpinyStarfish.java index 7719b2424b..e5c93b3751 100644 --- a/Mage.Sets/src/mage/cards/s/SpinyStarfish.java +++ b/Mage.Sets/src/mage/cards/s/SpinyStarfish.java @@ -88,7 +88,7 @@ class SpinyStarfishWatcher extends Watcher { private final Map regeneratedCount = new HashMap<>(); public SpinyStarfishWatcher() { - super(SpinyStarfishWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public SpinyStarfishWatcher(final SpinyStarfishWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java b/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java index 5494b6d1bf..9742ff206e 100644 --- a/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java +++ b/Mage.Sets/src/mage/cards/s/SpiritOfTheLabyrinth.java @@ -50,7 +50,7 @@ class SpiritOfTheLabyrinthWatcher extends Watcher { private final Set playersThatDrewCard; public SpiritOfTheLabyrinthWatcher() { - super(SpiritOfTheLabyrinthWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); this.playersThatDrewCard = new HashSet<>(); } diff --git a/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java b/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java index 4f276c5f25..065afc0eaf 100644 --- a/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java +++ b/Mage.Sets/src/mage/cards/s/SpoilsOfBlood.java @@ -61,7 +61,7 @@ class SpoilsOfBloodEffect extends OneShotEffect { if (controller != null) { CreaturesDiedThisTurnWatcher watcher = game.getState().getWatcher(CreaturesDiedThisTurnWatcher.class); if (watcher != null) { - new CreateTokenEffect(new SpoilsOfBloodHorrorToken(watcher.creaturesDiedThisTurn)).apply(game, source); + new CreateTokenEffect(new SpoilsOfBloodHorrorToken(watcher.getCreaturesDiedThisTurn())).apply(game, source); } return true; } @@ -77,10 +77,14 @@ class SpoilsOfBloodEffect extends OneShotEffect { class CreaturesDiedThisTurnWatcher extends Watcher { - public int creaturesDiedThisTurn = 0; + public int getCreaturesDiedThisTurn() { + return creaturesDiedThisTurn; + } + + private int creaturesDiedThisTurn = 0; public CreaturesDiedThisTurnWatcher() { - super(CreaturesDiedThisTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public CreaturesDiedThisTurnWatcher(final CreaturesDiedThisTurnWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SteelHellkite.java b/Mage.Sets/src/mage/cards/s/SteelHellkite.java index e0f6aca272..b114bfb4d6 100644 --- a/Mage.Sets/src/mage/cards/s/SteelHellkite.java +++ b/Mage.Sets/src/mage/cards/s/SteelHellkite.java @@ -104,7 +104,7 @@ class SteelHellkiteWatcher extends Watcher { private final Map> damageMap = new HashMap<>(); public SteelHellkiteWatcher() { - super(SteelHellkiteWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public SteelHellkiteWatcher(final SteelHellkiteWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SummoningTrap.java b/Mage.Sets/src/mage/cards/s/SummoningTrap.java index 0337caf7af..f7d55ddde2 100644 --- a/Mage.Sets/src/mage/cards/s/SummoningTrap.java +++ b/Mage.Sets/src/mage/cards/s/SummoningTrap.java @@ -67,10 +67,10 @@ enum SummoningTrapCondition implements Condition { class SummoningTrapWatcher extends Watcher { - Set players = new HashSet<>(); + private Set players = new HashSet<>(); public SummoningTrapWatcher() { - super(SummoningTrapWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public SummoningTrapWatcher(final SummoningTrapWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/s/SylvanLibrary.java b/Mage.Sets/src/mage/cards/s/SylvanLibrary.java index 5db817e5a7..259f1d9622 100644 --- a/Mage.Sets/src/mage/cards/s/SylvanLibrary.java +++ b/Mage.Sets/src/mage/cards/s/SylvanLibrary.java @@ -119,7 +119,7 @@ class SylvanLibraryCardsDrawnThisTurnWatcher extends Watcher { private final Map> cardsDrawnThisTurn = new HashMap<>(); public SylvanLibraryCardsDrawnThisTurnWatcher() { - super(SylvanLibraryCardsDrawnThisTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public SylvanLibraryCardsDrawnThisTurnWatcher(final SylvanLibraryCardsDrawnThisTurnWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TalarasBattalion.java b/Mage.Sets/src/mage/cards/t/TalarasBattalion.java index a2c6153e40..cba7bb5c0f 100644 --- a/Mage.Sets/src/mage/cards/t/TalarasBattalion.java +++ b/Mage.Sets/src/mage/cards/t/TalarasBattalion.java @@ -112,7 +112,7 @@ class TalarasBattalionWatcher extends Watcher { private final UUID cardId; public TalarasBattalionWatcher(UUID cardId) { - super(TalarasBattalionWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); this.cardId = cardId; } diff --git a/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java b/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java index 0c25b60d3d..f73f6f4151 100644 --- a/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java +++ b/Mage.Sets/src/mage/cards/t/TapestryOfTheAges.java @@ -68,10 +68,10 @@ enum PlayerCastNonCreatureSpellCondition implements Condition { class PlayerCastNonCreatureSpellWatcher extends Watcher { - Set playerIds = new HashSet<>(); + private Set playerIds = new HashSet<>(); public PlayerCastNonCreatureSpellWatcher() { - super(PlayerCastNonCreatureSpellWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayerCastNonCreatureSpellWatcher(final PlayerCastNonCreatureSpellWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TerritorialHellkite.java b/Mage.Sets/src/mage/cards/t/TerritorialHellkite.java index 1243212c27..6dfeef8232 100644 --- a/Mage.Sets/src/mage/cards/t/TerritorialHellkite.java +++ b/Mage.Sets/src/mage/cards/t/TerritorialHellkite.java @@ -70,7 +70,7 @@ class AttackedLastCombatWatcher extends Watcher { public final Map> attackedLastCombatPlayers = new HashMap<>(); public AttackedLastCombatWatcher() { - super(AttackedLastCombatWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public AttackedLastCombatWatcher(final AttackedLastCombatWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TheChainVeil.java b/Mage.Sets/src/mage/cards/t/TheChainVeil.java index 850a13adb9..972b89e991 100644 --- a/Mage.Sets/src/mage/cards/t/TheChainVeil.java +++ b/Mage.Sets/src/mage/cards/t/TheChainVeil.java @@ -60,7 +60,7 @@ class ActivatedLoyaltyAbilityWatcher extends Watcher { private final Set playerIds = new HashSet<>(); public ActivatedLoyaltyAbilityWatcher() { - super(ActivatedLoyaltyAbilityWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public ActivatedLoyaltyAbilityWatcher(final ActivatedLoyaltyAbilityWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TheFallen.java b/Mage.Sets/src/mage/cards/t/TheFallen.java index 88543624ea..1696dd0d6d 100644 --- a/Mage.Sets/src/mage/cards/t/TheFallen.java +++ b/Mage.Sets/src/mage/cards/t/TheFallen.java @@ -80,7 +80,7 @@ class TheFallenWatcher extends Watcher { private Map> playersAndWalkersDealtDamageThisGame = new HashMap<>(); // Map> public TheFallenWatcher() { - super(TheFallenWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public TheFallenWatcher(final TheFallenWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/ThirstingAxe.java b/Mage.Sets/src/mage/cards/t/ThirstingAxe.java index 169a5151ec..7462f5396c 100644 --- a/Mage.Sets/src/mage/cards/t/ThirstingAxe.java +++ b/Mage.Sets/src/mage/cards/t/ThirstingAxe.java @@ -83,12 +83,11 @@ class EquippedDealtCombatDamageToCreatureCondition implements Condition { class CombatDamageToCreatureWatcher extends Watcher { // which objects dealt combat damage to creature during the turn - public final Set dealtCombatDamageToCreature; + private final Set dealtCombatDamageToCreature; - static final String BASIC_KEY = "CombatDamageToCreatureWatcher"; public CombatDamageToCreatureWatcher() { - super(BASIC_KEY, WatcherScope.GAME); + super(WatcherScope.GAME); dealtCombatDamageToCreature = new HashSet<>(); } diff --git a/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java index 8c76a77173..77f82d9ddd 100644 --- a/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java +++ b/Mage.Sets/src/mage/cards/t/ThousandYearStorm.java @@ -88,7 +88,7 @@ class ThousandYearWatcher extends Watcher { private final Map amountOfInstantSorcerySpellsCastOnCurrentTurn = new HashMap<>(); public ThousandYearWatcher() { - super(ThousandYearWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public ThousandYearWatcher(final ThousandYearWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TidebinderMage.java b/Mage.Sets/src/mage/cards/t/TidebinderMage.java index bc6348a859..c4f3efa11b 100644 --- a/Mage.Sets/src/mage/cards/t/TidebinderMage.java +++ b/Mage.Sets/src/mage/cards/t/TidebinderMage.java @@ -130,7 +130,7 @@ class TidebinderMageEffect extends ContinuousRuleModifyingEffectImpl { class TidebinderMageWatcher extends Watcher { TidebinderMageWatcher () { - super("ControlLost", WatcherScope.CARD); + super(WatcherScope.CARD); } TidebinderMageWatcher(TidebinderMageWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TimeOfIce.java b/Mage.Sets/src/mage/cards/t/TimeOfIce.java index 01f9bc08d3..580d0b9c17 100644 --- a/Mage.Sets/src/mage/cards/t/TimeOfIce.java +++ b/Mage.Sets/src/mage/cards/t/TimeOfIce.java @@ -141,7 +141,7 @@ class TimeOfIceEffect extends ContinuousRuleModifyingEffectImpl { class TimeOfIceWatcher extends Watcher { TimeOfIceWatcher() { - super("ControlLost", WatcherScope.CARD); + super(WatcherScope.CARD); } TimeOfIceWatcher(TimeOfIceWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TimeToReflect.java b/Mage.Sets/src/mage/cards/t/TimeToReflect.java index ce2626dfdc..8dfd1c7131 100644 --- a/Mage.Sets/src/mage/cards/t/TimeToReflect.java +++ b/Mage.Sets/src/mage/cards/t/TimeToReflect.java @@ -72,7 +72,7 @@ class BlockedOrWasBlockedByAZombieWatcher extends Watcher { private final Set blockedOrWasBlockedByAZombieWatcher; public BlockedOrWasBlockedByAZombieWatcher() { - super(BlockedOrWasBlockedByAZombieWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); blockedOrWasBlockedByAZombieWatcher = new HashSet<>(); } diff --git a/Mage.Sets/src/mage/cards/t/TritonTactics.java b/Mage.Sets/src/mage/cards/t/TritonTactics.java index 573c6b6a70..f5f5a68fb8 100644 --- a/Mage.Sets/src/mage/cards/t/TritonTactics.java +++ b/Mage.Sets/src/mage/cards/t/TritonTactics.java @@ -185,7 +185,7 @@ class TritonTacticsEndOfCombatEffect extends OneShotEffect { class BlockedCreaturesWatcher extends Watcher { public BlockedCreaturesWatcher() { - super("BlockedCreatures", WatcherScope.CARD); + super(WatcherScope.CARD); } public BlockedCreaturesWatcher(final BlockedCreaturesWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TunnelIgnus.java b/Mage.Sets/src/mage/cards/t/TunnelIgnus.java index 13fc420221..7de16b3c3e 100644 --- a/Mage.Sets/src/mage/cards/t/TunnelIgnus.java +++ b/Mage.Sets/src/mage/cards/t/TunnelIgnus.java @@ -53,7 +53,7 @@ class TunnelIgnusWatcher extends Watcher { protected Map counts = new HashMap<>(); public TunnelIgnusWatcher() { - super(TunnelIgnusWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); } public TunnelIgnusWatcher(final TunnelIgnusWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java b/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java index 0f4e213e8e..3cda3fa397 100644 --- a/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java +++ b/Mage.Sets/src/mage/cards/t/TuvasaTheSunlit.java @@ -119,7 +119,7 @@ class TuvasaTheSunlitWatcher extends Watcher { private final Map firstEnchantmentThisTurn = new HashMap<>(); public TuvasaTheSunlitWatcher() { - super(TuvasaTheSunlitWatcher.class, WatcherScope.GAME); + super( WatcherScope.GAME); } public TuvasaTheSunlitWatcher(final TuvasaTheSunlitWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java b/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java index 87ec9fafdb..648aa4891d 100644 --- a/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java +++ b/Mage.Sets/src/mage/cards/t/TymnaTheWeaver.java @@ -97,7 +97,7 @@ class TymnaTheWeaverWatcher extends Watcher { private final Map> players = new HashMap<>(); public TymnaTheWeaverWatcher() { - super(TymnaTheWeaverWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public TymnaTheWeaverWatcher(final TymnaTheWeaverWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/u/UbaMask.java b/Mage.Sets/src/mage/cards/u/UbaMask.java index e58325f429..9f56aea2ef 100644 --- a/Mage.Sets/src/mage/cards/u/UbaMask.java +++ b/Mage.Sets/src/mage/cards/u/UbaMask.java @@ -132,7 +132,7 @@ class UbaMaskExiledCardsWatcher extends Watcher { private final Map> exiledCards = new HashMap<>(); public UbaMaskExiledCardsWatcher() { - super(UbaMaskExiledCardsWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public UbaMaskExiledCardsWatcher(final UbaMaskExiledCardsWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/u/UphillBattle.java b/Mage.Sets/src/mage/cards/u/UphillBattle.java index 51e2e495ac..de4f6e2521 100644 --- a/Mage.Sets/src/mage/cards/u/UphillBattle.java +++ b/Mage.Sets/src/mage/cards/u/UphillBattle.java @@ -46,11 +46,11 @@ public final class UphillBattle extends CardImpl { class PlayCreatureLandWatcher extends Watcher { - final Set playerPlayedLand = new HashSet<>(); // player that played land - final Set landPlayed = new HashSet<>(); // land played + private final Set playerPlayedLand = new HashSet<>(); // player that played land + private final Set landPlayed = new HashSet<>(); // land played public PlayCreatureLandWatcher() { - super(PlayCreatureLandWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayCreatureLandWatcher(final PlayCreatureLandWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/u/UrzasMiter.java b/Mage.Sets/src/mage/cards/u/UrzasMiter.java index 294efa29e1..9294d12231 100644 --- a/Mage.Sets/src/mage/cards/u/UrzasMiter.java +++ b/Mage.Sets/src/mage/cards/u/UrzasMiter.java @@ -74,7 +74,7 @@ class UrzasMiterWatcher extends Watcher { List cards; public UrzasMiterWatcher() { - super(UrzasMiterWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); this.cards = new ArrayList<>(); } diff --git a/Mage.Sets/src/mage/cards/v/VeneratedLoxodon.java b/Mage.Sets/src/mage/cards/v/VeneratedLoxodon.java index cfc3c483be..b1696346d9 100644 --- a/Mage.Sets/src/mage/cards/v/VeneratedLoxodon.java +++ b/Mage.Sets/src/mage/cards/v/VeneratedLoxodon.java @@ -97,7 +97,7 @@ class VeneratedLoxodonWatcher extends Watcher { private final Map> convokingCreatures = new HashMap<>(); public VeneratedLoxodonWatcher() { - super(VeneratedLoxodonWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public VeneratedLoxodonWatcher(final VeneratedLoxodonWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/v/Vengevine.java b/Mage.Sets/src/mage/cards/v/Vengevine.java index fd46580314..925fe3fc64 100644 --- a/Mage.Sets/src/mage/cards/v/Vengevine.java +++ b/Mage.Sets/src/mage/cards/v/Vengevine.java @@ -88,10 +88,10 @@ class VengevineAbility extends TriggeredAbilityImpl { class VengevineWatcher extends Watcher { - int creatureSpellCount = 0; + private int creatureSpellCount = 0; public VengevineWatcher() { - super(VengevineWatcher.class, WatcherScope.PLAYER); + super(WatcherScope.PLAYER); } public VengevineWatcher(final VengevineWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/v/VileRedeemer.java b/Mage.Sets/src/mage/cards/v/VileRedeemer.java index e66444d9f0..c766a49f45 100644 --- a/Mage.Sets/src/mage/cards/v/VileRedeemer.java +++ b/Mage.Sets/src/mage/cards/v/VileRedeemer.java @@ -97,7 +97,7 @@ class VileRedeemerNonTokenCreaturesDiedWatcher extends Watcher { private final Map amountOfCreaturesThatDied = new HashMap<>(); public VileRedeemerNonTokenCreaturesDiedWatcher() { - super(VileRedeemerNonTokenCreaturesDiedWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public VileRedeemerNonTokenCreaturesDiedWatcher(final VileRedeemerNonTokenCreaturesDiedWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/v/VizierOfManyFaces.java b/Mage.Sets/src/mage/cards/v/VizierOfManyFaces.java index 69799135a6..27efbbf652 100644 --- a/Mage.Sets/src/mage/cards/v/VizierOfManyFaces.java +++ b/Mage.Sets/src/mage/cards/v/VizierOfManyFaces.java @@ -97,7 +97,7 @@ class EmbalmedThisTurnWatcher extends Watcher { private final Set embalmedThisTurnTokens; public EmbalmedThisTurnWatcher() { - super(EmbalmedThisTurnWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); embalmedThisTurnTokens = new HashSet<>(); } diff --git a/Mage.Sets/src/mage/cards/v/VodalianWarMachine.java b/Mage.Sets/src/mage/cards/v/VodalianWarMachine.java index 1b7d8dde0f..8c925e69cc 100644 --- a/Mage.Sets/src/mage/cards/v/VodalianWarMachine.java +++ b/Mage.Sets/src/mage/cards/v/VodalianWarMachine.java @@ -163,7 +163,7 @@ class VodalianWarMachineWatcher extends Watcher { public Map> tappedMerfolkIds = new HashMap<>(); public VodalianWarMachineWatcher() { - super(VodalianWarMachineWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public VodalianWarMachineWatcher(final VodalianWarMachineWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/w/WhisperingSnitch.java b/Mage.Sets/src/mage/cards/w/WhisperingSnitch.java index baa075c2b9..3452d35243 100644 --- a/Mage.Sets/src/mage/cards/w/WhisperingSnitch.java +++ b/Mage.Sets/src/mage/cards/w/WhisperingSnitch.java @@ -89,7 +89,7 @@ class WhisperingSnitchWatcher extends Watcher { private final Map timesSurveiled = new HashMap<>(); public WhisperingSnitchWatcher() { - super(WhisperingSnitchWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public WhisperingSnitchWatcher(final WhisperingSnitchWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/w/Wiitigo.java b/Mage.Sets/src/mage/cards/w/Wiitigo.java index 79f7c766f8..7493405c22 100644 --- a/Mage.Sets/src/mage/cards/w/Wiitigo.java +++ b/Mage.Sets/src/mage/cards/w/Wiitigo.java @@ -96,7 +96,7 @@ class BlockedOrBeenBlockedSinceYourLastUpkeepWatcher extends Watcher { private final Map> blockedOrBeenBlockedCreatures = new HashMap<>(); public BlockedOrBeenBlockedSinceYourLastUpkeepWatcher() { - super(BlockedOrBeenBlockedSinceYourLastUpkeepWatcher.class, WatcherScope.GAME); + super(WatcherScope.GAME); } public BlockedOrBeenBlockedSinceYourLastUpkeepWatcher(BlockedOrBeenBlockedSinceYourLastUpkeepWatcher watcher) { diff --git a/Mage.Sets/src/mage/cards/w/WookieeMystic.java b/Mage.Sets/src/mage/cards/w/WookieeMystic.java index 1b82318eea..1d8f1d879d 100644 --- a/Mage.Sets/src/mage/cards/w/WookieeMystic.java +++ b/Mage.Sets/src/mage/cards/w/WookieeMystic.java @@ -78,7 +78,7 @@ class WookieeMysticWatcher extends Watcher { private final List creatures = new ArrayList<>(); WookieeMysticWatcher(Ability source) { - super("HallOfTheBanditLordWatcher", WatcherScope.CARD); + super(WatcherScope.CARD); this.source = source; } diff --git a/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java b/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java index e926b1318d..18f10b4289 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ExertAbility.java @@ -145,7 +145,7 @@ class ExertedThisTurnWatcher extends Watcher { private final Set exertedThisTurnCreatures; public ExertedThisTurnWatcher() { - super(ExertedThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); exertedThisTurnCreatures = new HashSet<>(); } diff --git a/Mage/src/main/java/mage/abilities/keyword/MeleeAbility.java b/Mage/src/main/java/mage/abilities/keyword/MeleeAbility.java index aeb04bc04e..061c000e83 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MeleeAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MeleeAbility.java @@ -1,10 +1,8 @@ package mage.abilities.keyword; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; +import java.util.*; + import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; @@ -45,10 +43,10 @@ public class MeleeAbility extends AttacksTriggeredAbility { class MeleeWatcher extends Watcher { - private HashMap> playersAttacked = new HashMap<>(0); + private Map> playersAttacked = new HashMap<>(0); MeleeWatcher() { - super("MeleeWatcher", WatcherScope.GAME); + super(WatcherScope.GAME); } MeleeWatcher(final MeleeWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/Watcher.java b/Mage/src/main/java/mage/watchers/Watcher.java index 9a941c0143..657c8ef502 100644 --- a/Mage/src/main/java/mage/watchers/Watcher.java +++ b/Mage/src/main/java/mage/watchers/Watcher.java @@ -15,18 +15,14 @@ import mage.game.events.GameEvent; */ public abstract class Watcher implements Serializable { - protected String basicKey; protected UUID controllerId; protected UUID sourceId; protected boolean condition; protected final WatcherScope scope; - public Watcher(Class watcherClass, WatcherScope scope){ - this(watcherClass.getSimpleName(), scope); - } - public Watcher(String basicKey, WatcherScope scope) { - this.basicKey = basicKey; + + public Watcher(WatcherScope scope) { this.scope = scope; } @@ -35,7 +31,6 @@ public abstract class Watcher implements Serializable { this.controllerId = watcher.controllerId; this.sourceId = watcher.sourceId; this.scope = watcher.scope; - this.basicKey = watcher.basicKey; } public UUID getControllerId() { @@ -57,13 +52,14 @@ public abstract class Watcher implements Serializable { public String getKey() { switch (scope) { case GAME: - return basicKey; + return getBasicKey(); case PLAYER: - return controllerId + basicKey; + return controllerId + getBasicKey(); case CARD: - return sourceId + basicKey; + return sourceId + getBasicKey(); + default: + return getBasicKey(); } - return basicKey; } public boolean conditionMet() { @@ -74,6 +70,10 @@ public abstract class Watcher implements Serializable { condition = false; } + protected String getBasicKey(){ + return getClass().getSimpleName(); + } + public abstract void watch(GameEvent event, Game game); public abstract Watcher copy(); diff --git a/Mage/src/main/java/mage/watchers/common/AmountOfDamageAPlayerReceivedThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/AmountOfDamageAPlayerReceivedThisTurnWatcher.java index 904adbb46e..c7e63fc85f 100644 --- a/Mage/src/main/java/mage/watchers/common/AmountOfDamageAPlayerReceivedThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/AmountOfDamageAPlayerReceivedThisTurnWatcher.java @@ -21,7 +21,7 @@ public class AmountOfDamageAPlayerReceivedThisTurnWatcher extends Watcher { private final Map amountOfDamageReceivedThisTurn = new HashMap<>(); public AmountOfDamageAPlayerReceivedThisTurnWatcher() { - super(AmountOfDamageAPlayerReceivedThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public AmountOfDamageAPlayerReceivedThisTurnWatcher(final AmountOfDamageAPlayerReceivedThisTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java index b8ca0dd44a..c6af696380 100644 --- a/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java @@ -24,7 +24,7 @@ public class AttackedLastTurnWatcher extends Watcher { public final Map> attackedThisTurnCreatures = new HashMap<>(); // dummy map for beginning of turn iteration purposes public AttackedLastTurnWatcher() { - super(AttackedLastTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public AttackedLastTurnWatcher(final AttackedLastTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/AttackedOrBlockedThisCombatWatcher.java b/Mage/src/main/java/mage/watchers/common/AttackedOrBlockedThisCombatWatcher.java index f4e36b11e4..0af8f15aa7 100644 --- a/Mage/src/main/java/mage/watchers/common/AttackedOrBlockedThisCombatWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/AttackedOrBlockedThisCombatWatcher.java @@ -19,29 +19,29 @@ import mage.watchers.Watcher; */ public class AttackedOrBlockedThisCombatWatcher extends Watcher { - public final Set attackedThisTurnCreatures = new HashSet<>(); - public final Set blockedThisTurnCreatures = new HashSet<>(); + private final Set attackedThisTurnCreatures = new HashSet<>(); + private final Set blockedThisTurnCreatures = new HashSet<>(); public AttackedOrBlockedThisCombatWatcher() { - super(AttackedOrBlockedThisCombatWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public AttackedOrBlockedThisCombatWatcher(final AttackedOrBlockedThisCombatWatcher watcher) { super(watcher); - this.attackedThisTurnCreatures.addAll(watcher.attackedThisTurnCreatures); - this.blockedThisTurnCreatures.addAll(watcher.blockedThisTurnCreatures); + this.getAttackedThisTurnCreatures().addAll(watcher.getAttackedThisTurnCreatures()); + this.getBlockedThisTurnCreatures().addAll(watcher.getBlockedThisTurnCreatures()); } @Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.BEGIN_COMBAT_STEP_PRE) { - this.attackedThisTurnCreatures.clear(); + this.getAttackedThisTurnCreatures().clear(); } if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - this.attackedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(), game)); + this.getAttackedThisTurnCreatures().add(new MageObjectReference(event.getSourceId(), game)); } if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - this.blockedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(), game)); + this.getBlockedThisTurnCreatures().add(new MageObjectReference(event.getSourceId(), game)); } } diff --git a/Mage/src/main/java/mage/watchers/common/AttackedThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/AttackedThisTurnWatcher.java index f470a6e06a..adedcff2cc 100644 --- a/Mage/src/main/java/mage/watchers/common/AttackedThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/AttackedThisTurnWatcher.java @@ -18,11 +18,11 @@ import java.util.Set; */ public class AttackedThisTurnWatcher extends Watcher { - protected final Set attackedThisTurnCreatures = new HashSet<>(); - protected final Map attackedThisTurnCreaturesCounts = new HashMap<>(); + private final Set attackedThisTurnCreatures = new HashSet<>(); + private final Map attackedThisTurnCreaturesCounts = new HashMap<>(); public AttackedThisTurnWatcher() { - super(AttackedThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public AttackedThisTurnWatcher(final AttackedThisTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/BlockedAttackerWatcher.java b/Mage/src/main/java/mage/watchers/common/BlockedAttackerWatcher.java index 1bfd8a2a1d..c6f896e376 100644 --- a/Mage/src/main/java/mage/watchers/common/BlockedAttackerWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/BlockedAttackerWatcher.java @@ -3,6 +3,7 @@ package mage.watchers.common; import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; import mage.MageObjectReference; import mage.constants.WatcherScope; @@ -18,10 +19,10 @@ import mage.watchers.Watcher; */ public class BlockedAttackerWatcher extends Watcher { - public final HashMap> blockData = new HashMap<>(); + private final Map> blockData = new HashMap<>(); public BlockedAttackerWatcher() { - super(BlockedAttackerWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public BlockedAttackerWatcher(final BlockedAttackerWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/BlockedByOnlyOneCreatureThisCombatWatcher.java b/Mage/src/main/java/mage/watchers/common/BlockedByOnlyOneCreatureThisCombatWatcher.java index 8cb13352df..b058d6136e 100644 --- a/Mage/src/main/java/mage/watchers/common/BlockedByOnlyOneCreatureThisCombatWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/BlockedByOnlyOneCreatureThisCombatWatcher.java @@ -18,7 +18,7 @@ public class BlockedByOnlyOneCreatureThisCombatWatcher extends Watcher { private final Map blockedByOneCreature = new HashMap<>(); public BlockedByOnlyOneCreatureThisCombatWatcher() { - super(BlockedByOnlyOneCreatureThisCombatWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public BlockedByOnlyOneCreatureThisCombatWatcher(final BlockedByOnlyOneCreatureThisCombatWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/BlockedThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/BlockedThisTurnWatcher.java index 4a7d6133c7..6d8b27ad05 100644 --- a/Mage/src/main/java/mage/watchers/common/BlockedThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/BlockedThisTurnWatcher.java @@ -19,7 +19,7 @@ public class BlockedThisTurnWatcher extends Watcher { private final Set blockedThisTurnCreatures; public BlockedThisTurnWatcher() { - super(BlockedThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); blockedThisTurnCreatures = new HashSet<>(); } diff --git a/Mage/src/main/java/mage/watchers/common/BloodthirstWatcher.java b/Mage/src/main/java/mage/watchers/common/BloodthirstWatcher.java index 784e44459a..0c2f96491d 100644 --- a/Mage/src/main/java/mage/watchers/common/BloodthirstWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/BloodthirstWatcher.java @@ -16,7 +16,7 @@ import java.util.UUID; */ public class BloodthirstWatcher extends Watcher { public BloodthirstWatcher(UUID controllerId) { - super(BloodthirstWatcher.class.getSimpleName(), WatcherScope.PLAYER); + super(WatcherScope.PLAYER); this.controllerId = controllerId; } diff --git a/Mage/src/main/java/mage/watchers/common/CardsAmountDrawnThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/CardsAmountDrawnThisTurnWatcher.java index 5b4ed5ca22..71c1a70306 100644 --- a/Mage/src/main/java/mage/watchers/common/CardsAmountDrawnThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CardsAmountDrawnThisTurnWatcher.java @@ -22,7 +22,7 @@ public class CardsAmountDrawnThisTurnWatcher extends Watcher { private final Map amountOfCardsDrawnThisTurn = new HashMap<>(); public CardsAmountDrawnThisTurnWatcher() { - super(CardsAmountDrawnThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CardsAmountDrawnThisTurnWatcher(final CardsAmountDrawnThisTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CardsCycledOrDiscardedThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/CardsCycledOrDiscardedThisTurnWatcher.java index a391fc9ec4..05f94ff6c8 100644 --- a/Mage/src/main/java/mage/watchers/common/CardsCycledOrDiscardedThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CardsCycledOrDiscardedThisTurnWatcher.java @@ -27,7 +27,7 @@ public class CardsCycledOrDiscardedThisTurnWatcher extends Watcher { private final Map> numberOfCycledOrDiscardedCardsThisTurn = new HashMap<>(); public CardsCycledOrDiscardedThisTurnWatcher() { - super(CardsCycledOrDiscardedThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CardsCycledOrDiscardedThisTurnWatcher(final CardsCycledOrDiscardedThisTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CardsDrawnDuringDrawStepWatcher.java b/Mage/src/main/java/mage/watchers/common/CardsDrawnDuringDrawStepWatcher.java index 477e24ae51..60cc296e91 100644 --- a/Mage/src/main/java/mage/watchers/common/CardsDrawnDuringDrawStepWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CardsDrawnDuringDrawStepWatcher.java @@ -24,7 +24,7 @@ public class CardsDrawnDuringDrawStepWatcher extends Watcher { private final Map amountOfCardsDrawnThisTurn = new HashMap<>(); public CardsDrawnDuringDrawStepWatcher() { - super(CardsDrawnDuringDrawStepWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CardsDrawnDuringDrawStepWatcher(final CardsDrawnDuringDrawStepWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CardsPutIntoGraveyardWatcher.java b/Mage/src/main/java/mage/watchers/common/CardsPutIntoGraveyardWatcher.java index bfd0fa5ff5..004019037d 100644 --- a/Mage/src/main/java/mage/watchers/common/CardsPutIntoGraveyardWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CardsPutIntoGraveyardWatcher.java @@ -29,7 +29,7 @@ public class CardsPutIntoGraveyardWatcher extends Watcher { private final Set cardsPutToGraveyardFromBattlefield = new HashSet<>(); public CardsPutIntoGraveyardWatcher() { - super(CardsPutIntoGraveyardWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CardsPutIntoGraveyardWatcher(final CardsPutIntoGraveyardWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CastFromGraveyardWatcher.java b/Mage/src/main/java/mage/watchers/common/CastFromGraveyardWatcher.java index 9729f92d11..2950ef15b0 100644 --- a/Mage/src/main/java/mage/watchers/common/CastFromGraveyardWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CastFromGraveyardWatcher.java @@ -20,7 +20,7 @@ public class CastFromGraveyardWatcher extends Watcher { private final Map> spellsCastFromGraveyard = new HashMap<>(); public CastFromGraveyardWatcher() { - super(CastFromGraveyardWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CastFromGraveyardWatcher(final CastFromGraveyardWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CastFromHandWatcher.java b/Mage/src/main/java/mage/watchers/common/CastFromHandWatcher.java index 6531c80dd4..58983d93bf 100644 --- a/Mage/src/main/java/mage/watchers/common/CastFromHandWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CastFromHandWatcher.java @@ -18,7 +18,7 @@ public class CastFromHandWatcher extends Watcher { private Step step; public CastFromHandWatcher() { - super(CastFromHandWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CastFromHandWatcher(final CastFromHandWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CastSpellLastTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/CastSpellLastTurnWatcher.java index 0beaff987e..e2ce491c06 100644 --- a/Mage/src/main/java/mage/watchers/common/CastSpellLastTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CastSpellLastTurnWatcher.java @@ -20,7 +20,7 @@ public class CastSpellLastTurnWatcher extends Watcher { private final List spellsCastThisTurnInOrder = new ArrayList<>(); public CastSpellLastTurnWatcher() { - super(CastSpellLastTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CastSpellLastTurnWatcher(final CastSpellLastTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java index 97a51a225d..6091ea5de8 100644 --- a/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CastSpellYourLastTurnWatcher.java @@ -19,7 +19,7 @@ public class CastSpellYourLastTurnWatcher extends Watcher { private UUID lastActivePlayer = null; public CastSpellYourLastTurnWatcher() { - super(CastSpellYourLastTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CastSpellYourLastTurnWatcher(final CastSpellYourLastTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/ChooseBlockersRedundancyWatcher.java b/Mage/src/main/java/mage/watchers/common/ChooseBlockersRedundancyWatcher.java index 8153aa9721..4d8fceaef5 100644 --- a/Mage/src/main/java/mage/watchers/common/ChooseBlockersRedundancyWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/ChooseBlockersRedundancyWatcher.java @@ -17,7 +17,7 @@ public class ChooseBlockersRedundancyWatcher extends Watcher { // workaround for public int copyCountApply = 0; public ChooseBlockersRedundancyWatcher() { - super(ChooseBlockersRedundancyWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public ChooseBlockersRedundancyWatcher(final ChooseBlockersRedundancyWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java b/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java index 22f3fc3ba5..99e7996ac0 100644 --- a/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CommanderInfoWatcher.java @@ -24,11 +24,11 @@ import mage.watchers.Watcher; */ public class CommanderInfoWatcher extends Watcher { - public final Map damageToPlayer = new HashMap<>(); - public final boolean checkCommanderDamage; + private final Map damageToPlayer = new HashMap<>(); + private final boolean checkCommanderDamage; public CommanderInfoWatcher(UUID commander, boolean checkCommanderDamage) { - super(CommanderInfoWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); this.sourceId = commander; this.checkCommanderDamage = checkCommanderDamage; } diff --git a/Mage/src/main/java/mage/watchers/common/CreatureAttackedWhichPlayerWatcher.java b/Mage/src/main/java/mage/watchers/common/CreatureAttackedWhichPlayerWatcher.java index a36deed585..6ebaee8ee6 100644 --- a/Mage/src/main/java/mage/watchers/common/CreatureAttackedWhichPlayerWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CreatureAttackedWhichPlayerWatcher.java @@ -20,7 +20,7 @@ public class CreatureAttackedWhichPlayerWatcher extends Watcher { private final Map getPlayerAttackedThisTurnByCreature = new HashMap<>(); public CreatureAttackedWhichPlayerWatcher() { - super(CreatureAttackedWhichPlayerWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CreatureAttackedWhichPlayerWatcher(final CreatureAttackedWhichPlayerWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java b/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java index aecb265f34..11f1fbf5b9 100644 --- a/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CreatureWasCastWatcher.java @@ -22,7 +22,7 @@ public class CreatureWasCastWatcher extends Watcher { private final Set creaturesCasted = new HashSet<>(); public CreatureWasCastWatcher() { - super(CreatureWasCastWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CreatureWasCastWatcher(final CreatureWasCastWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java b/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java index 5da28185c2..cf30c77490 100644 --- a/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/CreaturesDiedWatcher.java @@ -2,6 +2,7 @@ package mage.watchers.common; import java.util.HashMap; +import java.util.Map; import java.util.UUID; import mage.constants.WatcherScope; import mage.game.Game; @@ -14,11 +15,11 @@ import mage.watchers.Watcher; */ public class CreaturesDiedWatcher extends Watcher { - private final HashMap amountOfCreaturesThatDiedByController = new HashMap<>(); - private final HashMap amountOfCreaturesThatDiedByOwner = new HashMap<>(); + private final Map amountOfCreaturesThatDiedByController = new HashMap<>(); + private final Map amountOfCreaturesThatDiedByOwner = new HashMap<>(); public CreaturesDiedWatcher() { - super(CreaturesDiedWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public CreaturesDiedWatcher(final CreaturesDiedWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/DamageDoneWatcher.java b/Mage/src/main/java/mage/watchers/common/DamageDoneWatcher.java index 3247f2ed1d..9c7fdb1bb2 100644 --- a/Mage/src/main/java/mage/watchers/common/DamageDoneWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/DamageDoneWatcher.java @@ -21,18 +21,26 @@ import java.util.UUID; public class DamageDoneWatcher extends Watcher { // which object did how much damage during the turn - public final Map damagingObjects; + private final Map damagingObjects; + + public Map getDamagingObjects() { + return damagingObjects; + } + + public Map getDamagedObjects() { + return damagedObjects; + } // which object received how much damage during the turn - public final Map damagedObjects; + private final Map damagedObjects; public DamageDoneWatcher() { - super(DamageDoneWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); this.damagingObjects = new HashMap<>(); this.damagedObjects = new HashMap<>(); } - public DamageDoneWatcher(final DamageDoneWatcher watcher) { + private DamageDoneWatcher(final DamageDoneWatcher watcher) { super(watcher); this.damagingObjects = new HashMap<>(watcher.damagingObjects); this.damagedObjects = new HashMap<>(watcher.damagedObjects); diff --git a/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java b/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java index d45b1f4b4c..746d286f45 100644 --- a/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/DamagedByWatcher.java @@ -28,7 +28,7 @@ public class DamagedByWatcher extends Watcher { } public DamagedByWatcher(boolean watchPlaneswalkers) { - super(DamagedByWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); this.watchPlaneswalkers = watchPlaneswalkers; } diff --git a/Mage/src/main/java/mage/watchers/common/DragonOnTheBattlefieldWhileSpellWasCastWatcher.java b/Mage/src/main/java/mage/watchers/common/DragonOnTheBattlefieldWhileSpellWasCastWatcher.java index dd98b1f72c..46266a8218 100644 --- a/Mage/src/main/java/mage/watchers/common/DragonOnTheBattlefieldWhileSpellWasCastWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/DragonOnTheBattlefieldWhileSpellWasCastWatcher.java @@ -26,7 +26,7 @@ public class DragonOnTheBattlefieldWhileSpellWasCastWatcher extends Watcher { private final Set castWithDragonOnTheBattlefield = new HashSet<>(); public DragonOnTheBattlefieldWhileSpellWasCastWatcher() { - super(DragonOnTheBattlefieldWhileSpellWasCastWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public DragonOnTheBattlefieldWhileSpellWasCastWatcher(final DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/FirstSpellCastThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/FirstSpellCastThisTurnWatcher.java index db98da2824..c60052f27d 100644 --- a/Mage/src/main/java/mage/watchers/common/FirstSpellCastThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/FirstSpellCastThisTurnWatcher.java @@ -19,7 +19,7 @@ public class FirstSpellCastThisTurnWatcher extends Watcher { private final Map playerFirstCastSpell = new HashMap<>(); public FirstSpellCastThisTurnWatcher() { - super(FirstSpellCastThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public FirstSpellCastThisTurnWatcher(final FirstSpellCastThisTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/FirstTimeStepWatcher.java b/Mage/src/main/java/mage/watchers/common/FirstTimeStepWatcher.java index 8a90a6a2a5..26d8a0d393 100644 --- a/Mage/src/main/java/mage/watchers/common/FirstTimeStepWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/FirstTimeStepWatcher.java @@ -18,7 +18,7 @@ public class FirstTimeStepWatcher extends Watcher { private final EventType eventType; public FirstTimeStepWatcher(EventType eventType) { - super(eventType.toString() + FirstTimeStepWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); this.eventType = eventType; } @@ -38,4 +38,9 @@ public class FirstTimeStepWatcher extends Watcher { condition = true; } } + + @Override + public String getBasicKey(){ + return eventType.toString() + FirstTimeStepWatcher.class.getSimpleName(); + } } diff --git a/Mage/src/main/java/mage/watchers/common/GravestormWatcher.java b/Mage/src/main/java/mage/watchers/common/GravestormWatcher.java index 3f19961656..3b9afad51f 100644 --- a/Mage/src/main/java/mage/watchers/common/GravestormWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/GravestormWatcher.java @@ -19,7 +19,7 @@ public class GravestormWatcher extends Watcher { private int gravestormCount = 0; public GravestormWatcher() { - super(GravestormWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public GravestormWatcher(final GravestormWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java b/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java index dacc4a52cc..ce1827b8c3 100644 --- a/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/LandfallWatcher.java @@ -15,14 +15,14 @@ import mage.watchers.Watcher; */ public class LandfallWatcher extends Watcher { - final Set playerPlayedLand = new HashSet<>(); // player that had a land enter the battlefield - final Set landEnteredBattlefield = new HashSet<>(); // land played + private final Set playerPlayedLand = new HashSet<>(); // player that had a land enter the battlefield + private final Set landEnteredBattlefield = new HashSet<>(); // land played public LandfallWatcher() { - super(LandfallWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } - public LandfallWatcher(final LandfallWatcher watcher) { + private LandfallWatcher(final LandfallWatcher watcher) { super(watcher); playerPlayedLand.addAll(watcher.playerPlayedLand); landEnteredBattlefield.addAll(watcher.landEnteredBattlefield); diff --git a/Mage/src/main/java/mage/watchers/common/LifeLossOtherFromCombatWatcher.java b/Mage/src/main/java/mage/watchers/common/LifeLossOtherFromCombatWatcher.java index 473b319763..d35a740342 100644 --- a/Mage/src/main/java/mage/watchers/common/LifeLossOtherFromCombatWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/LifeLossOtherFromCombatWatcher.java @@ -19,7 +19,7 @@ public class LifeLossOtherFromCombatWatcher extends Watcher { private final Set players = new HashSet<>(); public LifeLossOtherFromCombatWatcher() { - super(LifeLossOtherFromCombatWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public LifeLossOtherFromCombatWatcher(final LifeLossOtherFromCombatWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/ManaSpentToCastWatcher.java b/Mage/src/main/java/mage/watchers/common/ManaSpentToCastWatcher.java index 615790dc02..127574ca08 100644 --- a/Mage/src/main/java/mage/watchers/common/ManaSpentToCastWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/ManaSpentToCastWatcher.java @@ -17,10 +17,10 @@ import mage.watchers.Watcher; */ public class ManaSpentToCastWatcher extends Watcher { - Mana payment = null; + private Mana payment = null; public ManaSpentToCastWatcher() { - super(ManaSpentToCastWatcher.class.getSimpleName(), WatcherScope.CARD); + super(WatcherScope.CARD); } public ManaSpentToCastWatcher(final ManaSpentToCastWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/MiracleWatcher.java b/Mage/src/main/java/mage/watchers/common/MiracleWatcher.java index e553478a63..325b958d59 100644 --- a/Mage/src/main/java/mage/watchers/common/MiracleWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/MiracleWatcher.java @@ -29,7 +29,7 @@ public class MiracleWatcher extends Watcher { private final Map amountOfCardsDrawnThisTurn = new HashMap<>(); public MiracleWatcher() { - super(MiracleWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public MiracleWatcher(final MiracleWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java b/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java index 8f29d2eda0..4e2877f1d9 100644 --- a/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/MorbidWatcher.java @@ -14,7 +14,7 @@ import mage.watchers.Watcher; public class MorbidWatcher extends Watcher { public MorbidWatcher() { - super(MorbidWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public MorbidWatcher(final MorbidWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/NumberOfTimesPermanentTargetedATurnWatcher.java b/Mage/src/main/java/mage/watchers/common/NumberOfTimesPermanentTargetedATurnWatcher.java index db149374d7..fa14361fd5 100644 --- a/Mage/src/main/java/mage/watchers/common/NumberOfTimesPermanentTargetedATurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/NumberOfTimesPermanentTargetedATurnWatcher.java @@ -20,7 +20,7 @@ public class NumberOfTimesPermanentTargetedATurnWatcher extends Watcher { private final Map permanentsTargeted = new HashMap<>(); public NumberOfTimesPermanentTargetedATurnWatcher() { - super(NumberOfTimesPermanentTargetedATurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public NumberOfTimesPermanentTargetedATurnWatcher(final NumberOfTimesPermanentTargetedATurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java index 870daa230f..b4bc3df198 100644 --- a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldWatcher.java @@ -5,10 +5,8 @@ */ package mage.watchers.common; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; + import mage.constants.WatcherScope; import mage.game.Game; import mage.game.events.GameEvent; @@ -21,11 +19,11 @@ import mage.watchers.Watcher; */ public class PermanentsEnteredBattlefieldWatcher extends Watcher { - private final HashMap> enteringBattlefield = new HashMap<>(); - private final HashMap> enteringBattlefieldLastTurn = new HashMap<>(); + private final Map> enteringBattlefield = new HashMap<>(); + private final Map> enteringBattlefieldLastTurn = new HashMap<>(); public PermanentsEnteredBattlefieldWatcher() { - super(PermanentsEnteredBattlefieldWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PermanentsEnteredBattlefieldWatcher(final PermanentsEnteredBattlefieldWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldYourLastTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldYourLastTurnWatcher.java index 331602e3f1..2c52ef3ed8 100644 --- a/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldYourLastTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PermanentsEnteredBattlefieldYourLastTurnWatcher.java @@ -11,10 +11,7 @@ import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.watchers.Watcher; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; /** * @@ -22,12 +19,12 @@ import java.util.UUID; */ public class PermanentsEnteredBattlefieldYourLastTurnWatcher extends Watcher { - private final HashMap> enteringBattlefield = new HashMap<>(); - private final HashMap> enteringBattlefieldLastTurn = new HashMap<>(); + private final Map> enteringBattlefield = new HashMap<>(); + private final Map> enteringBattlefieldLastTurn = new HashMap<>(); private UUID lastActivePlayer = null; public PermanentsEnteredBattlefieldYourLastTurnWatcher() { - super(PermanentsEnteredBattlefieldYourLastTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PermanentsEnteredBattlefieldYourLastTurnWatcher(final PermanentsEnteredBattlefieldYourLastTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PermanentsSacrificedWatcher.java b/Mage/src/main/java/mage/watchers/common/PermanentsSacrificedWatcher.java index 9e8119c4db..9db7329017 100644 --- a/Mage/src/main/java/mage/watchers/common/PermanentsSacrificedWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PermanentsSacrificedWatcher.java @@ -5,10 +5,8 @@ */ package mage.watchers.common; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; + import mage.constants.WatcherScope; import mage.game.Game; import mage.game.events.GameEvent; @@ -21,10 +19,10 @@ import mage.watchers.Watcher; */ public class PermanentsSacrificedWatcher extends Watcher { - private final HashMap> sacrificedPermanents = new HashMap<>(); + private final Map> sacrificedPermanents = new HashMap<>(); public PermanentsSacrificedWatcher() { - super(PermanentsSacrificedWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PermanentsSacrificedWatcher(final PermanentsSacrificedWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlanarRollWatcher.java b/Mage/src/main/java/mage/watchers/common/PlanarRollWatcher.java index 58c37e601d..d95ef4b62d 100644 --- a/Mage/src/main/java/mage/watchers/common/PlanarRollWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlanarRollWatcher.java @@ -21,7 +21,7 @@ public class PlanarRollWatcher extends Watcher { private final Map numberTimesPlanarDieRolled = new HashMap<>(); public PlanarRollWatcher() { - super(PlanarRollWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlanarRollWatcher(final PlanarRollWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java index 78686fe9ae..bc6769e219 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayLandWatcher.java @@ -14,11 +14,11 @@ import mage.watchers.Watcher; */ public class PlayLandWatcher extends Watcher { - final Set playerPlayedLand = new HashSet<>(); // player that played land - final Set landPlayed = new HashSet<>(); // land played + private final Set playerPlayedLand = new HashSet<>(); // player that played land + private final Set landPlayed = new HashSet<>(); // land played public PlayLandWatcher() { - super(PlayLandWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayLandWatcher(final PlayLandWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayerAttackedStepWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerAttackedStepWatcher.java index c38dc937ed..57e3702587 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerAttackedStepWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerAttackedStepWatcher.java @@ -18,7 +18,7 @@ public class PlayerAttackedStepWatcher extends Watcher { private final Map playerAttacked = new HashMap<>(); public PlayerAttackedStepWatcher() { - super(PlayerAttackedStepWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayerAttackedStepWatcher(final PlayerAttackedStepWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayerAttackedWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerAttackedWatcher.java index b9514120f1..be67da9b4f 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerAttackedWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerAttackedWatcher.java @@ -21,7 +21,7 @@ public class PlayerAttackedWatcher extends Watcher { private final Map playerAttacked = new HashMap<>(); public PlayerAttackedWatcher() { - super(PlayerAttackedWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayerAttackedWatcher(final PlayerAttackedWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java index f9cd63037d..420a019923 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerCastCreatureWatcher.java @@ -1,25 +1,25 @@ package mage.watchers.common; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.constants.WatcherScope; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; import mage.watchers.Watcher; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author LevelX2 */ public class PlayerCastCreatureWatcher extends Watcher { - final Set playerIds = new HashSet<>(); + private final Set playerIds = new HashSet<>(); public PlayerCastCreatureWatcher() { - super(PlayerCastCreatureWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayerCastCreatureWatcher(final PlayerCastCreatureWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayerDamagedBySourceWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerDamagedBySourceWatcher.java index b0ea417c8f..a14a63fe39 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerDamagedBySourceWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerDamagedBySourceWatcher.java @@ -21,7 +21,7 @@ public class PlayerDamagedBySourceWatcher extends Watcher { private final Set damageSourceIds = new HashSet<>(); public PlayerDamagedBySourceWatcher(UUID playerId) { - super(PlayerDamagedBySourceWatcher.class.getSimpleName(), WatcherScope.PLAYER); + super(WatcherScope.PLAYER); setControllerId(playerId); } diff --git a/Mage/src/main/java/mage/watchers/common/PlayerGainedLifeWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerGainedLifeWatcher.java index b9a9cba116..e067a5fb90 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerGainedLifeWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerGainedLifeWatcher.java @@ -21,7 +21,7 @@ public class PlayerGainedLifeWatcher extends Watcher { private final Map amountOfLifeGainedThisTurn = new HashMap<>(); public PlayerGainedLifeWatcher() { - super(PlayerGainedLifeWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } private PlayerGainedLifeWatcher(final PlayerGainedLifeWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayerLostLifeNonCombatWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerLostLifeNonCombatWatcher.java index 2c7300286c..a04027185d 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerLostLifeNonCombatWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerLostLifeNonCombatWatcher.java @@ -25,7 +25,7 @@ public class PlayerLostLifeNonCombatWatcher extends Watcher { private final Map amountOfLifeLostLastTurn = new HashMap<>(); public PlayerLostLifeNonCombatWatcher() { - super(PlayerLostLifeNonCombatWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayerLostLifeNonCombatWatcher(final PlayerLostLifeNonCombatWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java index 70c389b01d..c12b3711a0 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayerLostLifeWatcher.java @@ -23,7 +23,7 @@ public class PlayerLostLifeWatcher extends Watcher { private final Map amountOfLifeLostLastTurn = new HashMap<>(); public PlayerLostLifeWatcher() { - super(PlayerLostLifeWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayerLostLifeWatcher(final PlayerLostLifeWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayersAttackedLastTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayersAttackedLastTurnWatcher.java index 4ee5fb7898..2416759fb6 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayersAttackedLastTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayersAttackedLastTurnWatcher.java @@ -20,7 +20,7 @@ public class PlayersAttackedLastTurnWatcher extends Watcher { private final Map playersAttackedInLastTurn = new HashMap<>(); public PlayersAttackedLastTurnWatcher() { - super(PlayersAttackedLastTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayersAttackedLastTurnWatcher(final PlayersAttackedLastTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/PlayersAttackedThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/PlayersAttackedThisTurnWatcher.java index 0099fb1267..9587c7001d 100644 --- a/Mage/src/main/java/mage/watchers/common/PlayersAttackedThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/PlayersAttackedThisTurnWatcher.java @@ -20,7 +20,7 @@ public class PlayersAttackedThisTurnWatcher extends Watcher { private final Map opponentsAttackedThisTurn = new HashMap<>(); public PlayersAttackedThisTurnWatcher() { - super(PlayersAttackedThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public PlayersAttackedThisTurnWatcher(final PlayersAttackedThisTurnWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/ProwlWatcher.java b/Mage/src/main/java/mage/watchers/common/ProwlWatcher.java index b06c4d00b5..3357383265 100644 --- a/Mage/src/main/java/mage/watchers/common/ProwlWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/ProwlWatcher.java @@ -26,10 +26,10 @@ public class ProwlWatcher extends Watcher { private final Set allSubtypes = new HashSet<>(); public ProwlWatcher() { - super(ProwlWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } - public ProwlWatcher(final ProwlWatcher watcher) { + private ProwlWatcher(final ProwlWatcher watcher) { super(watcher); for (Entry> entry : watcher.damagingSubtypes.entrySet()) { damagingSubtypes.put(entry.getKey(), entry.getValue()); diff --git a/Mage/src/main/java/mage/watchers/common/RevoltWatcher.java b/Mage/src/main/java/mage/watchers/common/RevoltWatcher.java index 74f34fb3aa..65084d84cd 100644 --- a/Mage/src/main/java/mage/watchers/common/RevoltWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/RevoltWatcher.java @@ -22,7 +22,7 @@ public class RevoltWatcher extends Watcher { private final Set revoltActivePlayerIds = new HashSet<>(0); public RevoltWatcher() { - super(RevoltWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public RevoltWatcher(final RevoltWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/SourceDidDamageWatcher.java b/Mage/src/main/java/mage/watchers/common/SourceDidDamageWatcher.java index b082d7def3..e790aee96b 100644 --- a/Mage/src/main/java/mage/watchers/common/SourceDidDamageWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/SourceDidDamageWatcher.java @@ -19,7 +19,7 @@ public class SourceDidDamageWatcher extends Watcher { public final Set damageSources = new HashSet<>(); public SourceDidDamageWatcher() { - super(SourceDidDamageWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public SourceDidDamageWatcher(final SourceDidDamageWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/SpellsCastWatcher.java b/Mage/src/main/java/mage/watchers/common/SpellsCastWatcher.java index c40f0e0f07..64fe3db2d6 100644 --- a/Mage/src/main/java/mage/watchers/common/SpellsCastWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/SpellsCastWatcher.java @@ -5,10 +5,8 @@ */ package mage.watchers.common; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; +import java.util.*; + import mage.MageObject; import mage.constants.WatcherScope; import mage.constants.Zone; @@ -25,11 +23,11 @@ import mage.watchers.Watcher; */ public class SpellsCastWatcher extends Watcher { - private final HashMap> spellsCast = new HashMap<>(); + private final Map> spellsCast = new HashMap<>(); private int nonCreatureSpells; public SpellsCastWatcher() { - super(SpellsCastWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public SpellsCastWatcher(final SpellsCastWatcher watcher) { diff --git a/Mage/src/main/java/mage/watchers/common/WasBlockedThisTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/WasBlockedThisTurnWatcher.java index 65e44a07af..c142833210 100644 --- a/Mage/src/main/java/mage/watchers/common/WasBlockedThisTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/WasBlockedThisTurnWatcher.java @@ -19,11 +19,11 @@ public class WasBlockedThisTurnWatcher extends Watcher { private final Set wasBlockedThisTurnCreatures; public WasBlockedThisTurnWatcher() { - super(WasBlockedThisTurnWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); wasBlockedThisTurnCreatures = new HashSet<>(); } - public WasBlockedThisTurnWatcher(final WasBlockedThisTurnWatcher watcher) { + private WasBlockedThisTurnWatcher(final WasBlockedThisTurnWatcher watcher) { super(watcher); wasBlockedThisTurnCreatures = new HashSet<>(watcher.wasBlockedThisTurnCreatures); } diff --git a/Mage/src/main/java/mage/watchers/common/ZuberasDiedWatcher.java b/Mage/src/main/java/mage/watchers/common/ZuberasDiedWatcher.java index 12625b4c17..61c555cffe 100644 --- a/Mage/src/main/java/mage/watchers/common/ZuberasDiedWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/ZuberasDiedWatcher.java @@ -21,7 +21,7 @@ public class ZuberasDiedWatcher extends Watcher { private int zuberasDiedThisTurn = 0; public ZuberasDiedWatcher() { - super(ZuberasDiedWatcher.class.getSimpleName(), WatcherScope.GAME); + super(WatcherScope.GAME); } public ZuberasDiedWatcher(final ZuberasDiedWatcher watcher) {