mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00: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…
Reference in a new issue