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