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.
()
| 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() |
no test coverage detected