* Search in library -- Set required status depending on whether searched cards have stated quality (rules 701.15b, 701.15d).

This commit is contained in:
Quercitron 2014-06-19 02:58:29 +04:00
parent 3836e68dcf
commit aa606a1d3c
2 changed files with 5 additions and 2 deletions

View file

@ -112,6 +112,10 @@ public class FilterCard extends FilterObject<Card> {
}
return filtered;
}
public boolean hasPredicates() {
return predicates.size() > 0;
}
@Override
public FilterCard copy() {

View file

@ -65,13 +65,12 @@ public class TargetCardInLibrary extends TargetCard {
public TargetCardInLibrary(int minNumTargets, int maxNumTargets, FilterCard filter) {
super(minNumTargets, maxNumTargets, Zone.LIBRARY, filter);
this.setRequired(false);
this.setRequired(!filter.hasPredicates());
this.librarySearchLimit = Integer.MAX_VALUE;
}
public TargetCardInLibrary(final TargetCardInLibrary target) {
super(target);
this.setRequired(false);
this.librarySearchLimit = target.librarySearchLimit;
}