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

Method reIndex

forge-core/src/main/java/forge/card/CardDb.java:567–581  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

565 }
566
567 private void reIndex() {
568 uniqueCardsByRules.clear();
569 uniqueCardsByFlavorName.clear();
570 for (Entry<CardRules, Collection<PaperCard>> kv : allCardsByRules.asMap().entrySet()) {
571 PaperCard pc = getBestUniquePrint(kv.getValue());
572 uniqueCardsByRules.put(kv.getKey(), pc);
573 }
574 for (Entry<String, String> kv : flavorNameMappings.entrySet()) {
575 if (kv.getValue().equals(IPaperCard.NO_FUNCTIONAL_VARIANT))
576 continue;
577 String flavorName = kv.getKey();
578 PaperCard pc = getBestUniquePrint(allCardsByName.get(flavorName));
579 uniqueCardsByFlavorName.put(flavorName, pc);
580 }
581 }
582
583 private PaperCard getBestUniquePrint(final Collection<PaperCard> cards) {
584 return cards.stream()

Callers 3

loadCardMethod · 0.95
initializeMethod · 0.95
putCardMethod · 0.80

Calls 7

getBestUniquePrintMethod · 0.95
getMethod · 0.65
clearMethod · 0.45
getValueMethod · 0.45
putMethod · 0.45
getKeyMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected