mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
CardLists.filter now uses Predicates.and
This commit is contained in:
@@ -256,7 +256,11 @@ public class CardLists {
|
||||
}
|
||||
|
||||
public static CardCollection filter(Iterable<Card> cardList, Predicate<Card> f1, Predicate<Card> f2) {
|
||||
return new CardCollection(Iterables.filter(Iterables.filter(cardList, f1), f2));
|
||||
return new CardCollection(Iterables.filter(cardList, Predicates.and(f1, f2)));
|
||||
}
|
||||
|
||||
public static CardCollection filter(Iterable<Card> cardList, Iterable<Predicate<Card>> filt) {
|
||||
return new CardCollection(Iterables.filter(cardList, Predicates.and(filt)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,7 +279,11 @@ public class CardLists {
|
||||
}
|
||||
|
||||
public static List<Card> filterAsList(Iterable<Card> cardList, Predicate<Card> f1, Predicate<Card> f2) {
|
||||
return Lists.newArrayList((Iterables.filter(Iterables.filter(cardList, f1), f2)));
|
||||
return Lists.newArrayList(Iterables.filter(cardList, Predicates.and(f1, f2)));
|
||||
}
|
||||
|
||||
public static List<Card> filterAsList(Iterable<Card> cardList, Iterable<Predicate<Card>> filt) {
|
||||
return Lists.newArrayList(Iterables.filter(cardList, Predicates.and(filt)));
|
||||
}
|
||||
|
||||
public static int count(Iterable<Card> cardList, Predicate<Card> filt) {
|
||||
|
||||
Reference in New Issue
Block a user