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

Method getPCCText

code/src/java/pcgen/core/bonus/BonusObj.java:298–339  ·  view source on GitHub ↗

Retrieve the persistent text for this bonus. This text when reparsed will recreate the bonus. PCC Text is used as a name here as this output could also be used by the LST editors. @return The text to be saved for example in a character.

()

Source from the content-addressed store, hash-verified

296 * @return The text to be saved for example in a character.
297 */
298 public String getPCCText()
299 {
300 if (stringRepresentation == null)
301 {
302 final StringBuilder sb = new StringBuilder(50);
303
304 sb.append(getTypeOfBonus());
305 if (varPart != null && !varPart.isEmpty())
306 {
307 sb.append(varPart);
308 }
309
310 if (!bonusInfo.isEmpty())
311 {
312 for (int i = 0; i < bonusInfo.size(); ++i)
313 {
314 sb.append(i == 0 ? '|' : ',').append(unparseToken(bonusInfo.get(i)));
315 }
316 }
317 else
318 {
319 sb.append("|ERROR");
320 }
321
322 sb.append('|').append(bonusFormula);
323
324 if (!bonusType.isEmpty())
325 {
326 sb.append("|TYPE=").append(bonusType);
327 }
328
329 // And put the prereqs at the end of the string.
330 if (hasPrerequisites())
331 {
332 sb.append(Constants.PIPE);
333 sb.append(new PrerequisiteWriter().getPrerequisiteString(getPrerequisiteList(), Constants.PIPE));
334 }
335
336 stringRepresentation = sb.toString();
337 }
338 return stringRepresentation;
339 }
340
341 @Override
342 public String toString()

Callers 2

toStringMethod · 0.95
appendTempBonusesMethod · 0.95

Calls 10

getTypeOfBonusMethod · 0.95
unparseTokenMethod · 0.95
isEmptyMethod · 0.65
sizeMethod · 0.65
getMethod · 0.65
hasPrerequisitesMethod · 0.65
getPrerequisiteStringMethod · 0.65
getPrerequisiteListMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected