mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
move CardHelper::getColor to CardView::getColorText
This commit is contained in:
parent
63df7f65a7
commit
d60e01d497
4 changed files with 15 additions and 15 deletions
|
@ -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()) {
|
||||
|
|
|
@ -74,8 +74,8 @@ public class MageCardComparator implements Comparator<CardView> {
|
|||
break;
|
||||
// Color
|
||||
case 3:
|
||||
aCom = CardHelper.getColor(a);
|
||||
bCom = CardHelper.getColor(b);
|
||||
aCom = a.getColorText();
|
||||
bCom = a.getColorText();
|
||||
break;
|
||||
// Type
|
||||
case 4:
|
||||
|
|
|
@ -252,7 +252,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
castingCost = ManaSymbols.replaceSymbolsWithHTML(castingCost, ManaSymbols.Type.TABLE);
|
||||
return "<html>" + castingCost + "</html>";
|
||||
case 3:
|
||||
return CardHelper.getColor(c);
|
||||
return c.getColorText();
|
||||
case 4:
|
||||
return CardHelper.getType(c);
|
||||
case 5:
|
||||
|
|
|
@ -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 "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue