- Fixed the TableSorter.getRarity() method and it should now be compatible with the new set info. As a bonus, the new cards won in quest mode may now appear at the top of the list rather than requiring you to scroll down to the bottom of the listing.

This commit is contained in:
jendave
2011-08-07 00:48:18 +00:00
parent fa02c5985a
commit b3b4d0d409

View File

@@ -138,6 +138,34 @@ public class TableSorter implements Comparator<Card>, NewConstants
final private Integer getRarity(Card c) final private Integer getRarity(Card c)
{ {
String rarity = c.getRarity();
if (rarity.equals("new"))
return 1;
if (!c.getCurSetCode().equals("")) {
SetInfo si = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode());
if (si != null)
rarity = si.Rarity;
}
if (rarity.equals("Common"))
return 2;
else if (rarity.equals("Uncommon"))
return 3;
else if (rarity.equals("Rare"))
return 4;
else if (rarity.equals("Mythic"))
return 5;
else if (rarity.equals("Special"))
return 6;
else if (rarity.equals("Land"))
return 7;
else
return 8;
// This older form of the method no longer works as it is not compatible with set info.
/*
if(c.getRarity().equals("Common")) if(c.getRarity().equals("Common"))
return Integer.valueOf(1); return Integer.valueOf(1);
else if(c.getRarity().equals("Uncommon")) else if(c.getRarity().equals("Uncommon"))
@@ -148,6 +176,7 @@ public class TableSorter implements Comparator<Card>, NewConstants
return Integer.valueOf(4); return Integer.valueOf(4);
else else
return Integer.valueOf(5); return Integer.valueOf(5);
*/
} }
final private Long getValue(Card c) final private Long getValue(Card c)