mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +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,9 +51,17 @@ 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()) {
|
||||
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) {
|
||||
sbText.setLength(sbText.length() - 2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue