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

Method readObject

forge-core/src/main/java/forge/item/PaperCard.java:431–454  ·  view source on GitHub ↗
(ObjectInputStream ois)

Source from the content-addressed store, hash-verified

429 }
430
431 @Serial
432 private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
433 // default deserialization
434 ois.defaultReadObject();
435
436 IPaperCard pc = StaticData.instance().getCommonCards().getCard(name, edition, artIndex);
437 if (pc == null) {
438 pc = StaticData.instance().getVariantCards().getCard(name, edition, artIndex);
439 if (pc == null) {
440 System.out.println("PaperCard: " + name + " not found with set and index " + edition + ", " + artIndex);
441 pc = readObjectAlternate(name, edition);
442 if (pc == null) {
443 pc = StaticData.instance().getCommonCards().createUnsupportedCard(name);
444 //throw new IOException(TextUtil.concatWithSpace("Card", name, "not found with set and index", edition, Integer.toString(artIndex)));
445 }
446 System.out.println("Alternate object found: " + pc.getName() + ", " + pc.getEdition() + ", " + pc.getArtIndex());
447 }
448 }
449 rules = pc.getRules();
450 rarity = pc.getRarity();
451 displayName = pc.getDisplayName();
452 hasFlavorName = pc.hasFlavorName();
453 sortableName = TextUtil.toSortableName(CardTranslation.getTranslatedName(displayName));
454 }
455
456 private IPaperCard readObjectAlternate(String name, String edition) throws ClassNotFoundException, IOException {
457 IPaperCard pc = StaticData.instance().getCommonCards().getCard(name, edition);

Callers

nothing calls this directly

Calls 15

instanceMethod · 0.95
readObjectAlternateMethod · 0.95
getNameMethod · 0.95
getEditionMethod · 0.95
getArtIndexMethod · 0.95
getRulesMethod · 0.95
getRarityMethod · 0.95
toSortableNameMethod · 0.95
getTranslatedNameMethod · 0.95
getCommonCardsMethod · 0.80
getVariantCardsMethod · 0.80
createUnsupportedCardMethod · 0.80

Tested by

no test coverage detected