1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-12 09:11:05 -09:00

* UI: deck editor - added cards sorting by rarity ();

This commit is contained in:
Oleg Agafonov 2018-10-03 23:59:51 +04:00
parent 095ccc397e
commit 72d23bfe95
2 changed files with 17 additions and 11 deletions
Mage.Client/src/main/java/mage/client/deckeditor/table
Mage/src/main/java/mage/constants

View file

@ -27,6 +27,7 @@
package mage.client.deckeditor.table;
import java.util.Comparator;
import mage.cards.MageCard;
import mage.view.CardView;
@ -94,8 +95,8 @@ public class MageCardComparator implements Comparator<CardView> {
break;
// Rarity
case 6:
aCom = a.getRarity().toString();
bCom = b.getRarity().toString();
aCom = a.getRarity().getSorting();
bCom = b.getRarity().getSorting();
break;
// Set name
case 7:

View file

@ -1,29 +1,30 @@
package mage.constants;
/**
*
* @author North
*/
public enum Rarity {
LAND ("Land", "common", "C", 1),
COMMON ("Common", "common", "C", 1),
UNCOMMON ("Uncommon", "uncommon", "U", 2),
RARE ("Rare", "rare", "R", 3),
MYTHIC ("Mythic", "mythic", "M", 3),
SPECIAL ("Special", "special", "Special", 3),
BONUS ("Bonus", "bonus", "Bonus", 3);
LAND("Land", "common", "C", 1, 1),
COMMON("Common", "common", "C", 1, 2),
UNCOMMON("Uncommon", "uncommon", "U", 2, 3),
RARE("Rare", "rare", "R", 3, 4),
MYTHIC("Mythic", "mythic", "M", 3, 5),
SPECIAL("Special", "special", "Special", 3, 6),
BONUS("Bonus", "bonus", "Bonus", 3, 7);
private final String text;
private final String symbolCode;
private final String code;
private final int rating;
private final int sorting;
Rarity(String text, String symbolCode, String code, int rating) {
Rarity(String text, String symbolCode, String code, int rating, int sorting) {
this.text = text;
this.symbolCode = symbolCode;
this.code = code;
this.rating = rating;
this.sorting = sorting;
}
@Override
@ -42,4 +43,8 @@ public enum Rarity {
public int getRating() {
return rating;
}
public int getSorting() {
return sorting;
}
}