(ObjectInputStream ois)
| 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); |
nothing calls this directly
no test coverage detected