MCPcopy Create free account
hub / github.com/PCGen/pcgen / toString

Method toString

code/src/java/pcgen/core/kit/KitAbilities.java:66–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 }
65
66 @Override
67 public String toString()
68 {
69 StringBuilder sb = new StringBuilder();
70
71 if ((choiceCount != null) || (abilities.size() != 1))
72 {
73 sb.append(getSafeCount()).append(" of ");
74 }
75
76 boolean firstDone = false;
77
78 for (CDOMReference<Ability> ref : abilities)
79 {
80 if (firstDone)
81 {
82 sb.append("; ");
83 }
84 firstDone = true;
85
86 String choice = ref.getChoice();
87 for (Ability a : ref.getContainedObjects())
88 {
89 if (a != null)
90 {
91 sb.append(a.getKeyName());
92 if (choice != null)
93 {
94 sb.append(" (");
95 sb.append(choice);
96 sb.append(')');
97 }
98 }
99 }
100 }
101
102 if (isFree())
103 {
104 sb.append(" (free)");
105 }
106
107 return sb.toString();
108 }
109
110 @Override
111 public boolean testApply(Kit aKit, PlayerCharacter aPC, List<String> warnings)

Callers

nothing calls this directly

Calls 8

getSafeCountMethod · 0.95
isFreeMethod · 0.95
sizeMethod · 0.65
getContainedObjectsMethod · 0.65
getKeyNameMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45
getChoiceMethod · 0.45

Tested by

no test coverage detected