matchState is no longer public and deprecated for that

renamed function finding card's current zone getZone(card) to getZoneOf(card)
This commit is contained in:
Maxmtg
2011-09-19 05:03:56 +00:00
parent 18a7b1b433
commit eaad67694e
25 changed files with 78 additions and 80 deletions

View File

@@ -61,10 +61,8 @@ public final class AllZone implements NewConstants {
/**
* Match State for challenges are stored in a <code>QuestMatchState</code> class instance.
*
* @deprecated Variable 'matchState' must be private and have accessor methods.
*/
public static QuestMatchState matchState = new QuestMatchState();
private static QuestMatchState matchState = new QuestMatchState();
//initialized at Runtime since it has to be the last object constructed
@@ -424,7 +422,7 @@ public final class AllZone implements NewConstants {
* @param c a {@link forge.Card} object.
* @return a {@link forge.PlayerZone} object.
*/
public static PlayerZone getZone(final Card c) {
public static PlayerZone getZoneOf(final Card c) {
final FGameState gameState = Singletons.getModel().getGameState();
if (gameState == null) { return null; }

View File

@@ -282,7 +282,7 @@ public final class AllZoneUtil {
* @return a {@link forge.Card} object.
*/
public static Card getCardState(final Card card) {
PlayerZone zone = AllZone.getZone(card);
PlayerZone zone = AllZone.getZoneOf(card);
//for tokens
if (zone == null) {
return null;

View File

@@ -2090,7 +2090,7 @@ public class CombatUtil {
Enchantment = CardFactoryUtil.AI_getBestEnchantment(enchantments, attacker, false);
}
if (Enchantment != null && AllZoneUtil.isCardInPlay(attacker)) {
GameAction.changeZone(AllZone.getZone(Enchantment),
GameAction.changeZone(AllZone.getZoneOf(Enchantment),
Enchantment.getOwner().getZone(Constant.Zone.Battlefield), Enchantment);
Enchantment.enchantEntity(attacker);
}

View File

@@ -48,8 +48,8 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
//Immutable cards are usually emblems,effects and the mana pool and we don't want to log those.
if (!c.isImmutable()) {
cardsAddedThisTurn.add(c);
if (AllZone.getZone(c) != null) {
cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType());
if (AllZone.getZoneOf(c) != null) {
cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType());
} else {
cardsAddedThisTurnSource.add(null);
}
@@ -119,8 +119,8 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
//Immutable cards are usually emblems,effects and the mana pool and we don't want to log those.
if (!c.isImmutable()) {
cardsAddedThisTurn.add(c);
if (AllZone.getZone(c) != null) {
cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType());
if (AllZone.getZoneOf(c) != null) {
cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType());
} else {
cardsAddedThisTurnSource.add(null);
}
@@ -150,8 +150,8 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
//Immutable cards are usually emblems,effects and the mana pool and we don't want to log those.
if (!c.isImmutable()) {
cardsAddedThisTurn.add(c);
if (AllZone.getZone(c) != null) {
cardsAddedThisTurnSource.add(AllZone.getZone(c).getZoneType());
if (AllZone.getZoneOf(c) != null) {
cardsAddedThisTurnSource.add(AllZone.getZoneOf(c).getZoneType());
} else {
cardsAddedThisTurnSource.add(null);
}

View File

@@ -174,7 +174,7 @@ public class GameAction {
public final Card moveTo(final PlayerZone zone, Card c) {
// Ideally move to should never be called without a prevZone
// Remove card from Current Zone, if it has one
PlayerZone prev = AllZone.getZone(c);
PlayerZone prev = AllZone.getZoneOf(c);
//String prevName = prev != null ? prev.getZoneName() : "";
if (c.hasKeyword("If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else.")
@@ -251,7 +251,7 @@ public class GameAction {
*/
public final void controllerChangeZoneCorrection(final Card c) {
System.out.println("Correcting zone for " + c.toString());
PlayerZone oldBattlefield = AllZone.getZone(c);
PlayerZone oldBattlefield = AllZone.getZoneOf(c);
PlayerZone newBattlefield = c.getController().getZone(oldBattlefield.getZoneType());
if (oldBattlefield == null || newBattlefield == null) {
@@ -292,7 +292,7 @@ public class GameAction {
* @return a {@link forge.Card} object.
*/
public final Card moveToGraveyard(Card c) {
final PlayerZone origZone = AllZone.getZone(c);
final PlayerZone origZone = AllZone.getZoneOf(c);
final PlayerZone grave = c.getOwner().getZone(Constant.Zone.Graveyard);
if (AllZoneUtil.isCardInPlay("Leyline of the Void", c.getOwner().getOpponent())) {
@@ -444,7 +444,7 @@ public class GameAction {
* @return a {@link forge.Card} object.
*/
public final Card moveToLibrary(Card c, int libPosition) {
PlayerZone p = AllZone.getZone(c);
PlayerZone p = AllZone.getZoneOf(c);
PlayerZone library = c.getOwner().getZone(Constant.Zone.Library);
if (c.hasKeyword("If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else.")) {
@@ -1009,7 +1009,7 @@ public class GameAction {
@Override
public void resolve() {
if (AllZone.getZone(persistCard).is(Constant.Zone.Graveyard)) {
if (AllZone.getZoneOf(persistCard).is(Constant.Zone.Graveyard)) {
PlayerZone ownerPlay = persistCard.getOwner().getZone(Constant.Zone.Battlefield);
Card card = moveTo(ownerPlay, persistCard);
card.addCounter(Counters.M1M1, 1);
@@ -1557,7 +1557,7 @@ public class GameAction {
Player human = AllZone.getHumanPlayer();
if (c.isLand() && human.canPlayLand()) {
PlayerZone zone = AllZone.getZone(c);
PlayerZone zone = AllZone.getZoneOf(c);
if (zone.is(Constant.Zone.Hand)
|| (!zone.is(Constant.Zone.Battlefield)) && c.hasKeyword("May be played"))

View File

@@ -2366,7 +2366,7 @@ public final class GameActionUtil {
for (int i = 0; i < all.size(); i++) {
Card c = all.get(i);
if (c.getName().equals(cardName) && !c.isFaceDown()) {
zone.add(AllZone.getZone(c));
zone.add(AllZone.getZoneOf(c));
}
}

View File

@@ -135,7 +135,7 @@ public class MagicStack extends MyObservable {
// if the ability is a spell, but not a copied spell and its not already on the stack zone, move there
if (ability.isSpell()) {
Card source = ability.getSourceCard();
if (!source.isCopiedSpell() && !AllZone.getZone(source).is(Constant.Zone.Stack)) {
if (!source.isCopiedSpell() && !AllZone.getZoneOf(source).is(Constant.Zone.Stack)) {
AllZone.getGameAction().moveToStack(source);
}
}
@@ -859,7 +859,7 @@ public class MagicStack extends MyObservable {
// If Spell and still on the Stack then let it goto the graveyard or replace its own movement
else if (!source.isCopiedSpell() && (source.isInstant() || source.isSorcery() || fizzle)
&& AllZone.getZone(source).is(Constant.Zone.Stack))
&& AllZone.getZoneOf(source).is(Constant.Zone.Stack))
{
if (source.getReplaceMoveToGraveyard().size() == 0) {
AllZone.getGameAction().moveToGraveyard(source);

View File

@@ -801,7 +801,7 @@ public class Upkeep implements java.io.Serializable {
private static final long serialVersionUID = 4820011440853920644L;
public void resolve() {
if (AllZone.getZone(c).is(Constant.Zone.Battlefield)) {
if (AllZone.getZoneOf(c).is(Constant.Zone.Battlefield)) {
StringBuilder cost = new StringBuilder();
cost.append("Pay cost for ").append(c).append("\r\n");
GameActionUtil.payManaDuringAbilityResolve(cost.toString(), noPay.getManaCost(), Command.Blank, Command.Blank);
@@ -2599,7 +2599,7 @@ public class Upkeep implements java.io.Serializable {
c.setCloneOrigin(null);
//5
PlayerZone play = AllZone.getZone(c);
PlayerZone play = AllZone.getZoneOf(c);
play.remove(c);
play.add(newCopy);

View File

@@ -1496,7 +1496,7 @@ public final class AbilityFactory_ChangeZone {
if (tgtCards.size() != 0) {
for (Card tgtC : tgtCards) {
PlayerZone originZone = AllZone.getZone(tgtC);
PlayerZone originZone = AllZone.getZoneOf(tgtC);
// if Target isn't in the expected Zone, continue
if (originZone == null || !originZone.is(origin)) {
continue;

View File

@@ -223,7 +223,7 @@ public class AbilityFactory_Counters {
return false;
}
} else { // "put counter on this"
PlayerZone pZone = AllZone.getZone(source);
PlayerZone pZone = AllZone.getZoneOf(source);
// Don't activate Curse abilities on my cards and non-curse abilites on my opponents
if (!pZone.getPlayer().equals(player)) {
return false;
@@ -590,7 +590,7 @@ public class AbilityFactory_Counters {
for (Card tgtCard : tgtCards) {
if (tgt == null || CardFactoryUtil.canTarget(card, tgtCard)) {
if (AllZone.getZone(tgtCard).is(Constant.Zone.Battlefield)) {
if (AllZone.getZoneOf(tgtCard).is(Constant.Zone.Battlefield)) {
tgtCard.addCounter(Counters.valueOf(type), counterAmount);
}
else {
@@ -918,7 +918,7 @@ public class AbilityFactory_Counters {
for (Card tgtCard : tgtCards) {
if (tgt == null || CardFactoryUtil.canTarget(card, tgtCard)) {
PlayerZone zone = AllZone.getZone(tgtCard);
PlayerZone zone = AllZone.getZoneOf(tgtCard);
if (zone.is(Constant.Zone.Battlefield) || zone.is(Constant.Zone.Exile)) {
if (params.containsKey("UpTo") && sa.getActivatingPlayer().isHuman()) {
@@ -1533,7 +1533,7 @@ public class AbilityFactory_Counters {
}
for (Card tgtCard : cards) {
if (AllZone.getZone(tgtCard).is(Constant.Zone.Battlefield)) {
if (AllZone.getZoneOf(tgtCard).is(Constant.Zone.Battlefield)) {
tgtCard.addCounter(Counters.valueOf(type), counterAmount);
}
else {

View File

@@ -352,13 +352,13 @@ public class AbilityFactory_Sacrifice {
msg = "Sacrifice a " + msg;
if (valid.equals("Self")) {
if (AllZone.getZone(sa.getSourceCard()).is(Constant.Zone.Battlefield))
if (AllZone.getZoneOf(sa.getSourceCard()).is(Constant.Zone.Battlefield))
AllZone.getGameAction().sacrifice(sa.getSourceCard());
}
//TODO - maybe this can be done smarter...
else if (valid.equals("Card.AttachedBy")) {
Card toSac = sa.getSourceCard().getEnchantingCard();
if (AllZone.getZone(sa.getSourceCard()).is(Constant.Zone.Battlefield) && AllZoneUtil.isCardInPlay(toSac)) {
if (AllZone.getZoneOf(sa.getSourceCard()).is(Constant.Zone.Battlefield) && AllZoneUtil.isCardInPlay(toSac)) {
AllZone.getGameAction().sacrifice(toSac);
}
} else if (valid.equals("TriggeredCard")) {

View File

@@ -807,7 +807,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn
@Override
public boolean canPlay() {
return (AllZone.getZone(card).is(Constant.Zone.Battlefield));
return (AllZone.getZoneOf(card).is(Constant.Zone.Battlefield));
} //canPlay()
}; //SpellAbility ability1
@@ -1808,7 +1808,7 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn
AllZone.getTriggerHandler().removeAllFromCard(cloned[0]);
Card orig = cfact.getCard(card.getName(), card.getController());
PlayerZone dest = AllZone.getZone(card.getCurrentlyCloningCard());
PlayerZone dest = AllZone.getZoneOf(card.getCurrentlyCloningCard());
AllZone.getGameAction().moveTo(dest, orig);
dest.remove(card.getCurrentlyCloningCard());

View File

@@ -1384,7 +1384,7 @@ public class CardFactoryUtil {
// An animated artifact equipmemt can't equip a creature
@Override
public boolean canPlay() {
return AllZone.getZone(sourceCard).is(Constant.Zone.Battlefield) && !sourceCard.isCreature()
return AllZone.getZoneOf(sourceCard).is(Constant.Zone.Battlefield) && !sourceCard.isCreature()
&& Phase.canCastSorcery(sourceCard.getController());
}
@@ -2315,7 +2315,7 @@ public class CardFactoryUtil {
*/
public static boolean isTargetStillValid(final SpellAbility ability, final Card target) {
if (AllZone.getZone(target) == null) {
if (AllZone.getZoneOf(target) == null) {
return false; // for tokens that disappeared
}
@@ -2332,13 +2332,13 @@ public class CardFactoryUtil {
// Check if the target is in the zone it needs to be in to be
// targeted
if (!AllZone.getZone(target).is(tgt.getZone())) {
if (!AllZone.getZoneOf(target).is(tgt.getZone())) {
return false;
}
} else {
// If an Aura's target is removed before it resolves, the Aura
// fizzles
if (source.isAura() && !AllZone.getZone(target).is(Constant.Zone.Battlefield)) {
if (source.isAura() && !AllZone.getZoneOf(target).is(Constant.Zone.Battlefield)) {
return false;
}
}
@@ -2395,7 +2395,7 @@ public class CardFactoryUtil {
return false;
}
PlayerZone zone = AllZone.getZone(target);
PlayerZone zone = AllZone.getZoneOf(target);
// if zone is null, it means its on the stack
if (zone == null || !zone.is(Constant.Zone.Battlefield)) {
// targets not in play, can normally be targeted
@@ -2648,7 +2648,7 @@ public class CardFactoryUtil {
* @return a boolean.
*/
public static boolean activateFromExternalZones(final Card c, final Player player) {
PlayerZone zone = AllZone.getZone(c);
PlayerZone zone = AllZone.getZoneOf(c);
if (zone.is(Constant.Zone.Graveyard)) {
if (c.hasFlashback() || c.hasUnearth()) {
return true;
@@ -2661,7 +2661,7 @@ public class CardFactoryUtil {
}
for (SpellAbility sa : c.getSpellAbility()) {
if (AllZone.getZone(c).is(sa.getRestrictions().getZone())) {
if (AllZone.getZoneOf(c).is(sa.getRestrictions().getZone())) {
return true;
}

View File

@@ -507,7 +507,7 @@ class CardFactory_Auras {
}
Card animated = targetC[0];
PlayerZone grave = AllZone.getZone(animated);
PlayerZone grave = AllZone.getZoneOf(animated);
if (!grave.is(Constant.Zone.Graveyard)) {
// Animated Creature got removed before ability resolved

View File

@@ -357,7 +357,7 @@ public class CardFactory_Creatures {
@Override
public boolean canPlayAI() {
int reqHand = 1;
if (AllZone.getZone(card).is(Constant.Zone.Hand))
if (AllZone.getZoneOf(card).is(Constant.Zone.Hand))
reqHand++;
// Don't play if it would sacrifice as soon as it comes into play
@@ -509,7 +509,7 @@ public class CardFactory_Creatures {
@Override
public boolean canPlayAI() {
Object o = getArt.execute();
return (o != null) && AllZone.getZone(getSourceCard()).is(Constant.Zone.Hand);
return (o != null) && AllZone.getZoneOf(getSourceCard()).is(Constant.Zone.Hand);
}
});
card.addComesIntoPlayCommand(intoPlay);
@@ -811,7 +811,7 @@ public class CardFactory_Creatures {
AllZone.getStack().addSimultaneousStackEntry(new Ability(card, "0", "Adarkar Valkyrie - Return " + target[0] + " from graveyard to the battlefield") {
@Override
public void resolve() {
PlayerZone grave = AllZone.getZone(target[0]);
PlayerZone grave = AllZone.getZoneOf(target[0]);
//checks to see if card is still in the graveyard
if (grave != null && AllZoneUtil.isCardInZone(grave, target[0])) {
@@ -2779,7 +2779,7 @@ public class CardFactory_Creatures {
AllZone.getTriggerHandler().removeAllFromCard(cloned[0]);
Card orig = cfact.getCard(card.getName(), card.getController());
PlayerZone dest = AllZone.getZone(card.getCurrentlyCloningCard());
PlayerZone dest = AllZone.getZoneOf(card.getCurrentlyCloningCard());
AllZone.getGameAction().moveTo(dest, orig);
dest.remove(card.getCurrentlyCloningCard());
@@ -3064,7 +3064,7 @@ public class CardFactory_Creatures {
final SpellAbility awaken = new Ability(card, "0") {
@Override
public void resolve() {
if (!AllZone.getZone(card).is(Zone.Battlefield) || getTarget().getTargetCards().size() == 0)
if (!AllZone.getZoneOf(card).is(Zone.Battlefield) || getTarget().getTargetCards().size() == 0)
return;
final Card c = getTarget().getTargetCards().get(0);
String[] types = {"Creature", "Treefolk"};

View File

@@ -185,7 +185,7 @@ class CardFactory_Equipment {
//not changed
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& Phase.canCastSorcery(card.getController())
&& super.canPlay();
}

View File

@@ -78,7 +78,7 @@ public class CardFactory_Planeswalkers {
public boolean canPlay() {
return 0 < card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
@@ -119,7 +119,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return 8 <= card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -162,7 +162,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return 0 < card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -237,7 +237,7 @@ public class CardFactory_Planeswalkers {
public boolean canPlay() {
return 0 < card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
@@ -276,7 +276,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return 6 <= card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -327,7 +327,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return 0 < card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -402,7 +402,7 @@ public class CardFactory_Planeswalkers {
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
}
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}
@@ -473,7 +473,7 @@ public class CardFactory_Planeswalkers {
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
}
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}
@@ -554,7 +554,7 @@ public class CardFactory_Planeswalkers {
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
}
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& 7 < card.getCounters(Counters.LOYALTY)
&& Phase.canCastSorcery(card.getController());
@@ -687,7 +687,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -777,7 +777,7 @@ public class CardFactory_Planeswalkers {
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
}
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}
@@ -868,7 +868,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& card.getCounters(Counters.LOYALTY) >= 5
&& Phase.canCastSorcery(card.getController());
@@ -952,7 +952,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -1008,7 +1008,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -1044,7 +1044,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return card.getCounters(Counters.LOYALTY) >= 1
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}
@@ -1089,7 +1089,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return card.getCounters(Counters.LOYALTY) >= 12
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}
@@ -1154,7 +1154,7 @@ public class CardFactory_Planeswalkers {
public boolean canPlay() {
//looks like standard Planeswalker stuff...
//maybe should check if library is empty, or 1 card?
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -1213,7 +1213,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& card.getCounters(Counters.LOYALTY) >= 2
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
@@ -1256,7 +1256,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& card.getCounters(Counters.LOYALTY) >= 4
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
@@ -1315,7 +1315,7 @@ public class CardFactory_Planeswalkers {
public boolean canPlay() {
return 0 < card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
@@ -1353,7 +1353,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return 5 <= card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -1460,7 +1460,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return 0 < card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -1570,7 +1570,7 @@ public class CardFactory_Planeswalkers {
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
}
return 0 < card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()
@@ -1629,7 +1629,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Battlefield)
return AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& card.getCounters(Counters.LOYALTY) >= 1
&& Phase.canCastSorcery(card.getController());
@@ -1686,7 +1686,7 @@ public class CardFactory_Planeswalkers {
@Override
public boolean canPlay() {
return 8 <= card.getCounters(Counters.LOYALTY)
&& AllZone.getZone(card).is(Constant.Zone.Battlefield)
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
&& turn[0] != AllZone.getPhase().getTurn()
&& Phase.canCastSorcery(card.getController());
}//canPlay()

View File

@@ -201,7 +201,7 @@ public class CardFactory_Sorceries {
int i = 0;
for (Card target : creatures) {
if (AllZoneUtil.isCardInPlay(target)) {
orig.add(i, AllZone.getZone(target));
orig.add(i, AllZone.getZoneOf(target));
controllerEOT.add(i, target.getController());
targets.add(i, target);

View File

@@ -67,7 +67,7 @@ public class CostDiscard extends CostPartWithList {
Integer amount = convertAmount();
if (getThis()) {
if (!AllZone.getZone(source).is(Constant.Zone.Hand))
if (!AllZone.getZoneOf(source).is(Constant.Zone.Hand))
return false;
} else if (type.equals("Hand")) {
// this will always work

View File

@@ -28,7 +28,7 @@ public class CostReveal extends CostPartWithList {
Integer amount = convertAmount();
if (getThis()) {
if (!AllZone.getZone(source).is(Constant.Zone.Hand))
if (!AllZone.getZoneOf(source).is(Constant.Zone.Hand))
return false;
} else {
handList = handList.getValidCards(type.split(";"), activator, source);

View File

@@ -74,7 +74,7 @@ public class SpellAbility_Requirements {
if (!ability.getSourceCard().isCopiedSpell()) {
Card c = ability.getSourceCard();
fromZone = AllZone.getZone(c);
fromZone = AllZone.getZoneOf(c);
AllZone.getGameAction().moveToStack(c);
}
}

View File

@@ -136,7 +136,7 @@ public class SpellAbility_Restriction extends SpellAbility_Variables {
* @return a boolean.
*/
public boolean canPlay(Card c, SpellAbility sa) {
if (!AllZone.getZone(c).is(zone))
if (!AllZone.getZoneOf(c).is(zone))
return false;
Player activator = sa.getActivatingPlayer();

View File

@@ -240,7 +240,7 @@ public class Spell_Permanent extends Spell {
if (o == null) return false;
CardList cl = (CardList) championGetCreature.execute();
if ((o == null) || !(cl.size() > 0) || !AllZone.getZone(getSourceCard()).is(Constant.Zone.Hand))
if ((o == null) || !(cl.size() > 0) || !AllZone.getZoneOf(getSourceCard()).is(Constant.Zone.Hand))
return false;
}

View File

@@ -160,7 +160,7 @@ public class StaticAbility {
if (mapParams.containsKey("EffectZone"))
effectZone = Zone.smartValueOf(mapParams.get("EffectZone"));
if( effectZone != null && !AllZone.getZone(hostCard).getZoneType().equals(effectZone))
if( effectZone != null && !AllZone.getZoneOf(hostCard).getZoneType().equals(effectZone))
return false;
if(mapParams.containsKey("Threshold") && !controller.hasThreshold())

View File

@@ -225,10 +225,10 @@ public abstract class Trigger {
for (String s : mapParams.get("TriggerZones").split(",")) {
triggerZones.add(Zone.smartValueOf(s));
}
if (AllZone.getZone(hostCard) == null) {
if (AllZone.getZoneOf(hostCard) == null) {
return false;
}
if (!triggerZones.contains(AllZone.getZone(hostCard).getZoneType())) {
if (!triggerZones.contains(AllZone.getZoneOf(hostCard).getZoneType())) {
return false;
}
}