diff --git a/Mage.Client/src/main/java/mage/client/util/CardViewColorIdentityComparator.java b/Mage.Client/src/main/java/mage/client/util/CardViewColorIdentityComparator.java index 3c205f9bb6..36be3025d1 100644 --- a/Mage.Client/src/main/java/mage/client/util/CardViewColorIdentityComparator.java +++ b/Mage.Client/src/main/java/mage/client/util/CardViewColorIdentityComparator.java @@ -28,8 +28,7 @@ package mage.client.util; import java.util.Comparator; -import java.util.List; -import mage.ObjectColor; +import mage.utils.CardUtil; import mage.view.CardView; /** @@ -40,16 +39,7 @@ public class CardViewColorIdentityComparator implements Comparator { @Override public int compare(CardView o1, CardView o2) { - return sortValue(o1.getManaCost(), o1.getColor()) - sortValue(o2.getManaCost(), o2.getColor()); - } - - static public int sortValue(List manaCost, ObjectColor color) { - int hash = 3; - hash = 23 * hash + (color.isWhite() || manaCost.contains("{W}") ? 1 : 0); - hash = 23 * hash + (color.isBlue() || manaCost.contains("{U}") ? 1 : 0); - hash = 23 * hash + (color.isBlack() || manaCost.contains("{B}") ? 1 : 0); - hash = 23 * hash + (color.isRed() || manaCost.contains("{R}") ? 1 : 0); - hash = 23 * hash + (color.isGreen() || manaCost.contains("{G}") ? 1 : 0); - return hash; + return CardUtil.getColorIdentitySortValue(o1.getManaCost(), o1.getColor(), o1.getRules()) + - CardUtil.getColorIdentitySortValue(o2.getManaCost(), o2.getColor(), o2.getRules()); } } diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 4691eaa4f6..bb94926761 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -63,7 +63,7 @@ public enum CardRepository { // raise this if db structure was changed private static final long CARD_DB_VERSION = 41; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 37; + private static final long CARD_CONTENT_VERSION = 38; private final Random random = new Random(); private Dao cardDao;