mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
DeckHints: extend Type
This commit is contained in:
@@ -176,7 +176,14 @@ public class DeckHints {
|
||||
case TYPE:
|
||||
String[] types = param.split("\\|");
|
||||
for (String t : types) {
|
||||
Iterables.addAll(cards, getMatchingItems(cardList, CardRulesPredicates.subType(t), PaperCard.FN_GET_RULES));
|
||||
Predicate<CardRules> op;
|
||||
if (t.contains(".")) {
|
||||
String[] typeParts = t.split("\\.");
|
||||
op = Predicates.and(CardRulesPredicates.coreType(true, typeParts[0]), CardRulesPredicates.subType(typeParts[1]));
|
||||
} else {
|
||||
op = Predicates.or(CardRulesPredicates.coreType(true, t), CardRulesPredicates.subType(t));
|
||||
}
|
||||
Iterables.addAll(cards, getMatchingItems(cardList, op, PaperCard.FN_GET_RULES));
|
||||
}
|
||||
break;
|
||||
case NONE:
|
||||
|
||||
Reference in New Issue
Block a user