MCPcopy Create free account
hub / github.com/Card-Forge/forge / getBestUniquePrint

Method getBestUniquePrint

forge-core/src/main/java/forge/card/CardDb.java:583–589  ·  view source on GitHub ↗
(final Collection<PaperCard> cards)

Source from the content-addressed store, hash-verified

581 }
582
583 private PaperCard getBestUniquePrint(final Collection<PaperCard> cards) {
584 return cards.stream()
585 .filter(pc -> !pc.getRarity().equals(CardRarity.Special))
586 .min(Comparator.comparing((PaperCard pc) -> editions.get(pc.getEdition()), defaultCardArtPreference)
587 .thenComparing(PaperCard::getCollectorNumber))
588 .orElseGet(() -> cards.iterator().next());
589 }
590
591 public boolean setPreferredArt(String cardName, String setCode, int artIndex) {
592 String cardRequestForPreferredArt = CardRequest.compose(cardName, setCode, artIndex);

Callers 1

reIndexMethod · 0.95

Calls 9

streamMethod · 0.65
getRarityMethod · 0.65
getMethod · 0.65
getEditionMethod · 0.65
minMethod · 0.45
filterMethod · 0.45
equalsMethod · 0.45
nextMethod · 0.45
iteratorMethod · 0.45

Tested by

no test coverage detected