mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- 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:
@@ -136,19 +136,48 @@ public class TableSorter implements Comparator<Card>, NewConstants
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
final private Integer getRarity(Card c)
|
final private Integer getRarity(Card c)
|
||||||
{
|
{
|
||||||
if(c.getRarity().equals("Common"))
|
String rarity = c.getRarity();
|
||||||
return Integer.valueOf(1);
|
|
||||||
else if(c.getRarity().equals("Uncommon"))
|
if (rarity.equals("new"))
|
||||||
return Integer.valueOf(2);
|
return 1;
|
||||||
else if(c.getRarity().equals("Rare"))
|
|
||||||
return Integer.valueOf(3);
|
if (!c.getCurSetCode().equals("")) {
|
||||||
else if(c.getRarity().equals("Land"))
|
SetInfo si = SetInfoUtil.getSetInfo_Code(c.getSets(), c.getCurSetCode());
|
||||||
return Integer.valueOf(4);
|
if (si != null)
|
||||||
else
|
rarity = si.Rarity;
|
||||||
return Integer.valueOf(5);
|
}
|
||||||
}
|
|
||||||
|
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"))
|
||||||
|
return Integer.valueOf(1);
|
||||||
|
else if(c.getRarity().equals("Uncommon"))
|
||||||
|
return Integer.valueOf(2);
|
||||||
|
else if(c.getRarity().equals("Rare"))
|
||||||
|
return Integer.valueOf(3);
|
||||||
|
else if(c.getRarity().equals("Land"))
|
||||||
|
return Integer.valueOf(4);
|
||||||
|
else
|
||||||
|
return Integer.valueOf(5);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
final private Long getValue(Card c)
|
final private Long getValue(Card c)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user