(String cardName, String setCode, CardRules cr)
| 434 | } |
| 435 | |
| 436 | public void loadCard(String cardName, String setCode, CardRules cr) { |
| 437 | // @leriomaggio: This method is called when lazy-loading is set |
| 438 | // OR if a card is trying to load from an edition its not from |
| 439 | //System.out.println("[LOG]: (Lazy) Loading Card: " + cardName); |
| 440 | if (cr.hasPlaceholderFaces()) { |
| 441 | try { |
| 442 | cr.supplyPlaceholderFaces(facesByName); |
| 443 | } catch (NoSuchElementException e) { |
| 444 | e.printStackTrace(); |
| 445 | return; |
| 446 | } |
| 447 | } |
| 448 | boolean reIndexNecessary = false; |
| 449 | CardEdition ed = editions.get(setCode); |
| 450 | if (ed == null || ed.equals(CardEdition.UNKNOWN)) { |
| 451 | // look for all possible editions |
| 452 | for (CardEdition e : editions) { |
| 453 | reIndexNecessary |= addFromSetByName(cardName, e, cr); |
| 454 | } |
| 455 | } else { |
| 456 | reIndexNecessary |= addFromSetByName(cardName, ed, cr); |
| 457 | } |
| 458 | |
| 459 | if (reIndexNecessary) { |
| 460 | rulesByPrimaryName.putIfAbsent(cardName, cr); //TODO: Cache alt names here too. |
| 461 | reIndex(); |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | public void initialize(boolean logMissingPerEdition, boolean logMissingSummary, boolean enableUnknownCards) { |
| 466 | Set<String> allMissingCards = new LinkedHashSet<>(); |
no test coverage detected