move function AllZone.GameAction.isCardExiled(Card c) to AllZoneUtil and made static

This commit is contained in:
jendave
2011-08-06 23:27:06 +00:00
parent 477d61be47
commit acdb115f51
9 changed files with 12 additions and 14 deletions

View File

@@ -347,6 +347,9 @@ public class AllZoneUtil {
return cards;
}
public static boolean isCardExiled(Card c) {
return getCardsInExile().contains(c);
}
///Check if a certain card is in play

View File

@@ -580,7 +580,7 @@ public class Card extends MyObservable {
if(hasVanish && AllZone.GameAction.isCardInPlay(this))
AllZone.GameAction.sacrifice(this);
if(hasSuspend() && AllZone.GameAction.isCardExiled(this))
if(hasSuspend() && AllZoneUtil.isCardExiled(this))
{
final Card c = this;

View File

@@ -337,7 +337,7 @@ public class GameAction {
}
public Card exile(Card c) {
if(AllZone.GameAction.isCardExiled(c)) return c;
if(AllZoneUtil.isCardExiled(c)) return c;
PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, c.getOwner());
@@ -2183,11 +2183,6 @@ public class GameAction {
|| AllZoneUtil.isCardInZone(AllZone.Human_Graveyard, c);
}
public boolean isCardExiled(Card c) {
return AllZoneUtil.isCardInZone(AllZone.Computer_Exile, c)
|| AllZoneUtil.isCardInZone(AllZone.Human_Exile, c);
}
/**
* prompts Human to see if a target player's library should be shuffled. This should
* only be called when the choice is made by the Human (target can be either), then

View File

@@ -1498,7 +1498,7 @@ public class GameActionUtil {
@Override
public void resolve() {
if(AllZone.GameAction.isCardExiled(eve) && eve.getCounters(Counters.SCREAM) > 0) {
if(AllZoneUtil.isCardExiled(eve) && eve.getCounters(Counters.SCREAM) > 0) {
eve.subtractCounter(Counters.SCREAM, 1);
if(eve.getCounters(Counters.SCREAM) == 0) {
@@ -1520,7 +1520,7 @@ public class GameActionUtil {
StringBuilder sb = new StringBuilder();
sb.append(eve.getName()).append(" - remove a scream counter and return creatures to the battlefield.");
hallow.setStackDescription(sb.toString());
if(AllZone.GameAction.isCardExiled(eve)) {
if(AllZoneUtil.isCardExiled(eve)) {
AllZone.Stack.addSimultaneousStackEntry(hallow);
}

View File

@@ -1241,7 +1241,7 @@ public class CardFactory implements NewConstants {
public void execute() {
Object o = enchantment.getTargetCard();
if(o == null || ((Card) o).isToken() || !AllZone.GameAction.isCardExiled((Card) o)) return;
if(o == null || ((Card) o).isToken() || !AllZoneUtil.isCardExiled((Card) o)) return;
SpellAbility ability = new Ability(card, "0") {
@Override

View File

@@ -959,7 +959,7 @@ public class CardFactory_Creatures {
//System.out.println(abilityComes.getTargetCard().getName());
Object o = abilityComes.getTargetCard();
if(o == null || ((Card) o).isToken() || !AllZone.GameAction.isCardExiled((Card) o)) return;
if(o == null || ((Card) o).isToken() || !AllZoneUtil.isCardExiled((Card) o)) return;
SpellAbility ability = new Ability(card, "0") {
@Override

View File

@@ -1631,7 +1631,7 @@ class CardFactory_Planeswalkers {
private static final long serialVersionUID = -947355314271308770L;
public void execute() {
if(AllZone.GameAction.isCardExiled(c)) {
if(AllZoneUtil.isCardExiled(c)) {
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getOwner());
AllZone.GameAction.moveTo(play, AllZoneUtil.getCardState(c));
}

View File

@@ -3995,7 +3995,7 @@ public class CardFactory_Sorceries {
public void execute() {
//when this is in exile, and on the stack, this must get called again...
if(!AllZone.GameAction.isCardExiled(card)) {
if(!AllZoneUtil.isCardExiled(card)) {
AllZone.GameAction.exile(card);
card.addCounter(Counters.SCREAM, 2);
}

View File

@@ -105,7 +105,7 @@ public class Spell_Permanent extends Spell {
//System.out.println(abilityComes.getTargetCard().getName());
Object o = championAbilityComes.getTargetCard();
if(o == null || ((Card) o).isToken() || !AllZone.GameAction.isCardExiled((Card) o)) return;
if(o == null || ((Card) o).isToken() || !AllZoneUtil.isCardExiled((Card) o)) return;
SpellAbility ability = new Ability(getSourceCard(), "0") {
@Override