abilityToString. @return a java.lang.String object.
()
| 851 | * @return a {@link java.lang.String} object. |
| 852 | */ |
| 853 | private String abilityToString() { |
| 854 | final StringBuilder cost = new StringBuilder(); |
| 855 | boolean first = true; |
| 856 | |
| 857 | for (final CostPart part : this.costParts) { |
| 858 | boolean append = true; |
| 859 | if (!first) { |
| 860 | if (part instanceof CostPartMana) { |
| 861 | cost.insert(0, ", ").insert(0, part.toString()); |
| 862 | append = false; |
| 863 | } else { |
| 864 | cost.append(", "); |
| 865 | } |
| 866 | } |
| 867 | if (append) { |
| 868 | cost.append(part.toString()); |
| 869 | } |
| 870 | first = false; |
| 871 | } |
| 872 | |
| 873 | if (first) { |
| 874 | cost.append("0"); |
| 875 | } |
| 876 | |
| 877 | return cost.toString(); |
| 878 | } |
| 879 | |
| 880 | // TODO: If a Cost needs to pay more than 10 of something, fill this array as appropriate |
| 881 | /** |