mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
getCard(str,bool) now returns planes or schemes properly
This commit is contained in:
@@ -397,6 +397,11 @@ public final class CardDb {
|
|||||||
// Find card with maximal set index
|
// Find card with maximal set index
|
||||||
result = Aggregates.itemWithMax(namedCards, CardPrinted.FN_GET_EDITION_INDEX);
|
result = Aggregates.itemWithMax(namedCards, CardPrinted.FN_GET_EDITION_INDEX);
|
||||||
if (null == result) {
|
if (null == result) {
|
||||||
|
// 2nd chance: look in planes, schemes and so on
|
||||||
|
final Iterable<CardPrinted> namedNonTraditionals = Iterables.filter(this.allNonTraditionalCardsFlat, predicate);
|
||||||
|
result = Aggregates.itemWithMax(namedNonTraditionals, CardPrinted.FN_GET_EDITION_INDEX);
|
||||||
|
|
||||||
|
if ( null == result ) // sure thing, throw exception
|
||||||
throw new NoSuchElementException(String.format("Card '%s' not found in our database.", name));
|
throw new NoSuchElementException(String.format("Card '%s' not found in our database.", name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user