mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
Added the four finalists from You Make the Cube.
This commit is contained in:
parent
1f4c0eb1d9
commit
abfcd0ab10
1 changed files with 23 additions and 0 deletions
|
@ -156,6 +156,9 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
case NAME:
|
||||
Collections.sort(sortedCards, new CardNameComparator());
|
||||
break;
|
||||
case CARD_TYPE:
|
||||
Collections.sort(sortedCards, new CardTypeComparator());
|
||||
break;
|
||||
case RARITY:
|
||||
Collections.sort(sortedCards, new CardRarityComparator());
|
||||
break;
|
||||
|
@ -183,6 +186,12 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
curRow = 0;
|
||||
}
|
||||
break;
|
||||
case CARD_TYPE:
|
||||
if (!cardImg.getOriginal().getCardTypes().equals(lastCard.getOriginal().getCardTypes())) {
|
||||
curColumn++;
|
||||
curRow = 0;
|
||||
}
|
||||
break;
|
||||
case RARITY:
|
||||
if (!cardImg.getOriginal().getRarity().equals(lastCard.getOriginal().getRarity())) {
|
||||
curColumn++;
|
||||
|
@ -438,3 +447,17 @@ class CardColorDetailedIdentity implements Comparator<MageCard> {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class CardTypeComparator implements Comparator<MageCard> {
|
||||
|
||||
@Override
|
||||
public int compare(MageCard o1, MageCard o2) {
|
||||
int val = o1.getOriginal().getCardTypes().toString().compareTo(o2.getOriginal().getCardTypes().toString());
|
||||
if (val == 0) {
|
||||
return o1.getOriginal().getName().compareTo(o2.getOriginal().getName());
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue