mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Guava migration - Preliminary
This commit is contained in:
@@ -196,7 +196,7 @@ public final class CardRulesPredicates {
|
||||
try {
|
||||
return CardRulesPredicates.coreType(isEqual, Enum.valueOf(CardType.CoreType.class, what));
|
||||
} catch (final Exception e) {
|
||||
return com.google.common.base.Predicates.alwaysFalse();
|
||||
return x -> false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public final class CardRulesPredicates {
|
||||
try {
|
||||
return CardRulesPredicates.superType(isEqual, Enum.valueOf(CardType.Supertype.class, what));
|
||||
} catch (final Exception e) {
|
||||
return com.google.common.base.Predicates.alwaysFalse();
|
||||
return x -> false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,14 +123,12 @@ public class DeckHints {
|
||||
for (Pair<Type, String> pair : filters) {
|
||||
Type type = pair.getLeft();
|
||||
String param = pair.getRight();
|
||||
Iterable<PaperCard> cards = getCardsForFilter(cardList, type, param);
|
||||
if (cards != null) {
|
||||
// if a type is used more than once intersect respective matches
|
||||
if (ret.containsKey(type)) {
|
||||
Iterables.retainAll(cards, new FCollection<>(ret.get(type)));
|
||||
}
|
||||
ret.put(type, cards);
|
||||
List<PaperCard> cards = getCardsForFilter(cardList, type, param);
|
||||
// if a type is used more than once intersect respective matches
|
||||
if (ret.containsKey(type)) {
|
||||
cards.retainAll(new FCollection<>(ret.get(type)));
|
||||
}
|
||||
ret.put(type, cards);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -166,7 +164,7 @@ public class DeckHints {
|
||||
return pair;
|
||||
}
|
||||
|
||||
private Iterable<PaperCard> getCardsForFilter(Iterable<PaperCard> cardList, Type type, String param) {
|
||||
private List<PaperCard> getCardsForFilter(Iterable<PaperCard> cardList, Type type, String param) {
|
||||
List<PaperCard> cards = new ArrayList<>();
|
||||
|
||||
// this is case ABILITY, but other types can also use this when the implicit parsing would miss
|
||||
|
||||
Reference in New Issue
Block a user