Tests: added support of TargetCardInExile, TargetCardInGraveyard and variations;

This commit is contained in:
Oleg Agafonov 2018-11-21 16:42:00 +04:00
parent 21d7207551
commit a9451711bb
3 changed files with 84 additions and 19 deletions

View file

@ -47,6 +47,14 @@ public class FilterPlaneswalkerOrPlayer extends FilterImpl<Object> {
this.playerFilter = filter.playerFilter.copy();
}
public FilterPlaneswalkerPermanent getFilterPermanent() {
return this.planeswalkerFilter;
}
public FilterPlayer getFilterPlayer() {
return this.playerFilter;
}
@Override
public boolean checkObjectClass(Object object) {
return true;

View file

@ -9,7 +9,10 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import java.util.stream.Collectors;
import mage.cards.Card;
import mage.filter.FilterCard;
import mage.util.Copyable;
/**
@ -70,6 +73,11 @@ public class Exile implements Serializable, Copyable<Exile> {
return null;
}
public List<Card> getCards(FilterCard filter, Game game) {
List<Card> allCards = getAllCards(game);
return allCards.stream().filter(card -> filter.match(card, game)).collect(Collectors.toList());
}
public List<Card> getAllCards(Game game) {
List<Card> cards = new ArrayList<>();
for (ExileZone exile : exileZones.values()) {