MCPcopy Create free account
hub / github.com/Card-Forge/forge / abilityToString

Method abilityToString

forge-game/src/main/java/forge/game/cost/Cost.java:853–878  ·  view source on GitHub ↗

abilityToString. @return a java.lang.String object.

()

Source from the content-addressed store, hash-verified

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 /**

Callers 1

toStringMethod · 0.95

Calls 3

insertMethod · 0.45
toStringMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected