* 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

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

View file

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