mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Revert unnecessary changes of getCards()
This commit is contained in:
@@ -636,7 +636,7 @@ public class Game {
|
||||
if (!visitor.visitAll(player.getZone(ZoneType.Library).getCards())) {
|
||||
return;
|
||||
}
|
||||
if (!visitor.visitAll(player.getZone(ZoneType.Battlefield).getCards(false, true))) {
|
||||
if (!visitor.visitAll(player.getZone(ZoneType.Battlefield).getCards(false))) {
|
||||
return;
|
||||
}
|
||||
if (!visitor.visitAll(player.getZone(ZoneType.Exile).getCards())) {
|
||||
|
||||
@@ -100,7 +100,7 @@ public class SubgameEffect extends SpellAbilityEffect {
|
||||
final FCollectionView<Player> players = subgame.getPlayers();
|
||||
final FCollectionView<Player> maingamePlayers = maingame.getPlayers();
|
||||
final List<ZoneType> outsideZones = Arrays.asList(ZoneType.Hand, ZoneType.Battlefield,
|
||||
ZoneType.Graveyard, ZoneType.Exile, ZoneType.Stack, ZoneType.Sideboard, ZoneType.Ante);
|
||||
ZoneType.Graveyard, ZoneType.Exile, ZoneType.Stack, ZoneType.Sideboard, ZoneType.Ante, ZoneType.Merged);
|
||||
|
||||
for (int i = 0; i < players.size(); i++) {
|
||||
final Player player = players.get(i);
|
||||
|
||||
@@ -4283,7 +4283,7 @@ public class CardFactoryUtil {
|
||||
final StringBuilder sbMutate = new StringBuilder();
|
||||
sbMutate.append("SP$ Mutate | Cost$ ");
|
||||
sbMutate.append(cost);
|
||||
sbMutate.append(" | Mutate True | ValidTgts$ Creature.sharesOwnerWith+nonHuman");
|
||||
sbMutate.append(" | ValidTgts$ Creature.sharesOwnerWith+nonHuman");
|
||||
|
||||
final SpellAbility sa = AbilityFactory.getAbility(sbMutate.toString(), card);
|
||||
sa.setDescription("Mutate " + ManaCostParser.parse(cost) +
|
||||
|
||||
@@ -1497,7 +1497,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
|
||||
PlayerZone zone = getZone(zoneType);
|
||||
return zone == null ? CardCollection.EMPTY : zone.getCards(filterOutPhasedOut, true);
|
||||
return zone == null ? CardCollection.EMPTY : zone.getCards(filterOutPhasedOut);
|
||||
}
|
||||
|
||||
public final CardCollectionView getCardsIncludePhasingIn(final ZoneType zone) {
|
||||
|
||||
@@ -470,7 +470,7 @@ public class PlayerView extends GameEntityView {
|
||||
void updateZone(PlayerZone zone) {
|
||||
TrackableProperty prop = getZoneProp(zone.getZoneType());
|
||||
if (prop == null) { return; }
|
||||
set(prop, CardView.getCollection(zone.getCards(false, true)));
|
||||
set(prop, CardView.getCollection(zone.getCards(false)));
|
||||
|
||||
//update delirium
|
||||
if (ZoneType.Graveyard == zone.getZoneType())
|
||||
|
||||
@@ -106,7 +106,7 @@ public class PlayerZone extends Zone {
|
||||
}
|
||||
|
||||
public CardCollectionView getCardsPlayerCanActivate(Player who) {
|
||||
CardCollectionView cl = getCards(false, true);
|
||||
CardCollectionView cl = getCards(false);
|
||||
boolean checkingForOwner = who == player;
|
||||
|
||||
if (checkingForOwner && (is(ZoneType.Battlefield) || is(ZoneType.Hand))) {
|
||||
|
||||
@@ -84,20 +84,18 @@ public class PlayerZoneBattlefield extends PlayerZone {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final CardCollectionView getCards(final boolean filterOutPhasedOut, final boolean filterOutMerged) {
|
||||
public final CardCollectionView getCards(final boolean filter) {
|
||||
// Battlefield filters out Phased Out cards by default. Needs to call
|
||||
// getCards(false) to get Phased Out cards
|
||||
// For merged permanent, also filter out all merged cards except the top one
|
||||
|
||||
CardCollectionView cards = super.getCards(false, false);
|
||||
if (!filterOutPhasedOut && !filterOutMerged) {
|
||||
CardCollectionView cards = super.getCards(false);
|
||||
if (!filter) {
|
||||
return cards;
|
||||
}
|
||||
|
||||
boolean hasFilteredCard = false;
|
||||
for (Card c : cards) {
|
||||
if (filterOutPhasedOut && c.isPhasedOut() ||
|
||||
filterOutMerged && c.getMergedToCard() != null) {
|
||||
if (c.isPhasedOut()) {
|
||||
hasFilteredCard = true;
|
||||
break;
|
||||
}
|
||||
@@ -106,8 +104,7 @@ public class PlayerZoneBattlefield extends PlayerZone {
|
||||
if (hasFilteredCard) {
|
||||
CardCollection filteredCollection = new CardCollection();
|
||||
for (Card c : cards) {
|
||||
if ((!filterOutPhasedOut || !c.isPhasedOut()) &&
|
||||
(!filterOutMerged || c.getMergedToCard() == null)) {
|
||||
if (!c.isPhasedOut()) {
|
||||
filteredCollection.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,10 +190,10 @@ public class Zone implements java.io.Serializable, Iterable<Card> {
|
||||
}
|
||||
|
||||
public final CardCollectionView getCards() {
|
||||
return getCards(true, true);
|
||||
return getCards(true);
|
||||
}
|
||||
|
||||
public CardCollectionView getCards(final boolean filterOutPhasedOut, final boolean filterOutMerged) {
|
||||
public CardCollectionView getCards(final boolean filter) {
|
||||
return cardList; // Non-Battlefield PlayerZones don't care about the filter
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user