Skip to content

Commit

Permalink
refactor: shared logic for diff implementation of isInUseableZone, im…
Browse files Browse the repository at this point in the history
…proved docs and readability;
  • Loading branch information
JayDi85 committed Nov 30, 2024
1 parent 57ef74d commit d49ff89
Show file tree
Hide file tree
Showing 76 changed files with 287 additions and 275 deletions.
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/a/AjanisLastStand.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/a/AthreosGodOfPassage.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/a/AvacynsCollar.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/b/Bereavement.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/d/DeathTyrant.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/d/DeathsPresence.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/d/DiregrafCaptain.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/f/FalkenrathNoble.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/g/GraveBetrayal.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/g/GravePact.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/g/GutterGrime.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/h/HatefulEidolon.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/i/InfestedThrinax.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/l/LuminousBroodmoth.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/l/LyndeCheerfulTormentor.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MarchesaTheBlackRose.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MariTheKillingQuill.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MartyrsBond.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MassacreGirl.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MassacreWurm.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
6 changes: 3 additions & 3 deletions Mage.Sets/src/mage/cards/m/MillicentRestlessRevenant.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
} else {
return super.isInUseableZone(game, source, event);
return super.isInUseableZone(game, sourceObject, event);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MimicVat.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MolderBeast.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public MolderBeastTriggeredAbility copy() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/m/MycoidShepherd.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public MycoidShepherdTriggeredAbility copy() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/n/Necroskitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/n/NetherTraitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/n/NimDeathmantle.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/o/OrahSkyclaveHierophant.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/p/PatronOfTheVein.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/p/PiasRevolution.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/p/ProperBurial.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/p/Purgatory.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/r/Remembrance.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
6 changes: 3 additions & 3 deletions Mage.Sets/src/mage/cards/r/RhukHexgoldNabber.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
} else {
return super.isInUseableZone(game, source, event);
return super.isInUseableZone(game, sourceObject, event);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/r/RienneAngelOfRebirth.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/s/SacredGround.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public String getRule() {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}
4 changes: 2 additions & 2 deletions Mage.Sets/src/mage/cards/s/Sangromancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public boolean checkTrigger(GameEvent event, Game game) {
}

@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
public boolean isInUseableZone(Game game, MageObject sourceObject, GameEvent event) {
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, sourceObject, event, game);
}
}

Expand Down
Loading

0 comments on commit d49ff89

Please sign in to comment.