refactor getStartingPlaneswalkerOptions

This commit is contained in:
Anthony Calosa
2021-04-25 11:49:05 +08:00
parent 9b83c78346
commit d227da0c10
2 changed files with 16 additions and 6 deletions

View File

@@ -628,6 +628,21 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
}));
}
public Collection<PaperCard> getAllNonPromosNonReprintsNoAlt() {
return Lists.newArrayList(Iterables.filter(getAllCardsNoAlt(), new Predicate<PaperCard>() {
@Override
public boolean apply(final PaperCard paperCard) {
CardEdition edition = null;
try {
edition = editions.getEditionByCodeOrThrow(paperCard.getEdition());
} catch (Exception ex) {
return false;
}
return edition != null && (edition.getType() != Type.PROMOS||edition.getType() != Type.REPRINT);
}
}));
}
public String getName(final String cardName) {
if (alternateName.containsKey(cardName)) {
return alternateName.get(cardName);