mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Tests: added support of TargetCardInExile, TargetCardInGraveyard and variations;
This commit is contained in:
parent
21d7207551
commit
a9451711bb
3 changed files with 84 additions and 19 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue