Revert to CollectorNumber in PaperCard as String to handle cases of mulitple art (e.g. 21a).

This commit is contained in:
leriomaggio
2021-05-23 16:52:12 +01:00
parent a0c126f39e
commit c03da7eb74
4 changed files with 14 additions and 21 deletions

View File

@@ -96,7 +96,7 @@ public enum ColumnDef {
public Object apply(final Entry<? extends InventoryItem, Integer> from) {
InventoryItem item = from.getKey();
return item instanceof PaperCard ?
String.format("%03d", ((PaperCard) item).getCollectorNumber()) : "";
((PaperCard) item).getCollectorNumber() : IPaperCard.NO_COLLECTOR_NUMBER;
}
}),
/**The type column.*/
@@ -581,7 +581,7 @@ public enum ColumnDef {
@return A sortable numeric string based on the item's attributes.*/
private static String toCollectorPrefix(final InventoryItem i) {
//make sure it's a card. if not, pointless to proceed.
return (i instanceof PaperCard ? String.format("%03d", ((PaperCard) i).getCollectorNumber()) : "") + toSortableName(i.getName());
return (i instanceof PaperCard ? ((PaperCard) i).getCollectorNumber() : IPaperCard.NO_COLLECTOR_NUMBER) + toSortableName(i.getName());
}
/**Returns 1 for land, otherwise 0 and continues sorting.