mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
Fixed text for costs starting with "and"
This commit is contained in:
parent
91003b79dd
commit
be23f19a32
1 changed files with 9 additions and 1 deletions
|
|
@ -51,7 +51,15 @@ public class CostsImpl<T extends Cost> extends ArrayList<T> implements Costs<T>
|
|||
for (T cost : this) {
|
||||
String textCost = cost.getText();
|
||||
if (textCost != null && !textCost.isEmpty()) {
|
||||
sbText.append(Character.toUpperCase(textCost.charAt(0))).append(textCost.substring(1)).append(", ");
|
||||
if (textCost.startsWith("and")) {
|
||||
if (sbText.length() > 1) {
|
||||
// Remove "," from previous cost
|
||||
sbText.deleteCharAt(sbText.length() - 2);
|
||||
}
|
||||
sbText.append(textCost).append(", ");
|
||||
} else {
|
||||
sbText.append(Character.toUpperCase(textCost.charAt(0))).append(textCost.substring(1)).append(", ");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sbText.length() > 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue