forked from External/mage
All 1-character strings converted to primitives
"b" + "r" now changed to 'b' + 'w'. It's more straight-forward, and may cause perfomance improvements - character primitives allocation is faster and less expensive than string creation.
This commit is contained in:
parent
31589778ca
commit
f60ebfbb1f
451 changed files with 989 additions and 978 deletions
|
|
@ -56,17 +56,17 @@ public class CardHelper {
|
|||
StringBuilder type = new StringBuilder();
|
||||
for (String superType : c.getSuperTypes()) {
|
||||
type.append(superType);
|
||||
type.append(" ");
|
||||
type.append(' ');
|
||||
}
|
||||
for (CardType cardType : c.getCardTypes()) {
|
||||
type.append(cardType.toString());
|
||||
type.append(" ");
|
||||
type.append(' ');
|
||||
}
|
||||
if (c.getSubTypes().size() > 0) {
|
||||
type.append("- ");
|
||||
for (String subType : c.getSubTypes()) {
|
||||
type.append(subType);
|
||||
type.append(" ");
|
||||
type.append(' ');
|
||||
}
|
||||
}
|
||||
return type.toString();
|
||||
|
|
|
|||
|
|
@ -86,10 +86,10 @@ public class MageCardComparator implements Comparator<CardView> {
|
|||
aCom = (float) -1;
|
||||
bCom = (float) -1;
|
||||
if (CardHelper.isCreature(a)) {
|
||||
aCom = new Float(a.getPower() + "." + (a.getToughness().startsWith("-") ? "0" : a.getToughness()));
|
||||
aCom = new Float(a.getPower() + '.' + (a.getToughness().startsWith("-") ? "0" : a.getToughness()));
|
||||
}
|
||||
if (CardHelper.isCreature(b)) {
|
||||
bCom = new Float(b.getPower() + "." + (b.getToughness().startsWith("-") ? "0" : b.getToughness()));
|
||||
bCom = new Float(b.getPower() + '.' + (b.getToughness().startsWith("-") ? "0" : b.getToughness()));
|
||||
}
|
||||
break;
|
||||
// Rarity
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
case 4:
|
||||
return CardHelper.getType(c);
|
||||
case 5:
|
||||
return CardHelper.isCreature(c) ? c.getPower() + "/"
|
||||
return CardHelper.isCreature(c) ? c.getPower() + '/'
|
||||
+ c.getToughness() : "-";
|
||||
case 6:
|
||||
return c.getRarity().toString();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue