From d60e01d497f1b54dde35d405d7d39ca2bf338c98 Mon Sep 17 00:00:00 2001 From: ingmargoudt Date: Thu, 6 Apr 2017 22:11:57 +0200 Subject: [PATCH] move CardHelper::getColor to CardView::getColorText --- .../mage/client/deckeditor/table/CardHelper.java | 13 +------------ .../client/deckeditor/table/MageCardComparator.java | 4 ++-- .../mage/client/deckeditor/table/TableModel.java | 2 +- Mage.Common/src/mage/view/CardView.java | 11 +++++++++++ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java index e0407e0723..356dafdfd8 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/CardHelper.java @@ -41,18 +41,7 @@ import mage.view.CardView; public final class CardHelper { private CardHelper() { } - - public static String getColor(CardView c) { - if (c.getColor().getColorCount() == 0) return "Colorless"; - else if (c.getColor().getColorCount() > 1) return "Gold"; - else if (c.getColor().isBlack()) return "Black"; - else if (c.getColor().isBlue()) return "Blue"; - else if (c.getColor().isWhite()) return "White"; - else if (c.getColor().isGreen()) return "Green"; - else if (c.getColor().isRed()) return "Red"; - return ""; - } - + public static String getType(CardView c) { StringBuilder type = new StringBuilder(); for (SuperType superType : c.getSuperTypes()) { diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java index 217aa1e782..b8b145d09d 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/MageCardComparator.java @@ -74,8 +74,8 @@ public class MageCardComparator implements Comparator { break; // Color case 3: - aCom = CardHelper.getColor(a); - bCom = CardHelper.getColor(b); + aCom = a.getColorText(); + bCom = a.getColorText(); break; // Type case 4: diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java index b1655cd968..e4f2452900 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/TableModel.java @@ -252,7 +252,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid { castingCost = ManaSymbols.replaceSymbolsWithHTML(castingCost, ManaSymbols.Type.TABLE); return "" + castingCost + ""; case 3: - return CardHelper.getColor(c); + return c.getColorText(); case 4: return CardHelper.getType(c); case 5: diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index c8f14d59c0..e9eba628fa 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -961,4 +961,15 @@ public class CardView extends SimpleCardView { return cardTypes.contains(CardType.CREATURE); } + public String getColorText() { + if (getColor().getColorCount() == 0) return "Colorless"; + else if (getColor().getColorCount() > 1) return "Gold"; + else if (getColor().isBlack()) return "Black"; + else if (getColor().isBlue()) return "Blue"; + else if (getColor().isWhite()) return "White"; + else if (getColor().isGreen()) return "Green"; + else if (getColor().isRed()) return "Red"; + return ""; + } + }