Get the Kit info for this PC @param aPC the PC this kit is being applied to. @return the Kit info for this PC
(PlayerCharacter aPC)
| 323 | * @return the Kit info for this PC |
| 324 | */ |
| 325 | public String getInfo(PlayerCharacter aPC) |
| 326 | { |
| 327 | StringBuilder info = new StringBuilder(255); |
| 328 | info.append("<html>"); |
| 329 | info.append("<b><font size=+1>"); |
| 330 | info.append(OutputNameFormatting.piString(this)); |
| 331 | info.append("</font></b><br>\n"); |
| 332 | |
| 333 | String aString = getPreReqHTMLStrings(aPC); |
| 334 | |
| 335 | if (!aString.isEmpty()) |
| 336 | { |
| 337 | info.append(" <b>Requirements</b>: ").append(aString); |
| 338 | } |
| 339 | |
| 340 | List<BaseKit> sortedObjects = new ArrayList<>(getSafeListFor(ListKey.KIT_TASKS)); |
| 341 | sortedObjects.sort(Comparator.comparing(BaseKit::getObjectName)); |
| 342 | |
| 343 | String lastObjectName = ""; |
| 344 | for (BaseKit bk : sortedObjects) |
| 345 | { |
| 346 | String objName = bk.getObjectName(); |
| 347 | if (!objName.equals(lastObjectName)) |
| 348 | { |
| 349 | if (!lastObjectName.isEmpty()) |
| 350 | { |
| 351 | info.append("; "); |
| 352 | } |
| 353 | info.append(" <b>").append(objName).append("</b>: "); |
| 354 | lastObjectName = objName; |
| 355 | } |
| 356 | else |
| 357 | { |
| 358 | info.append(", "); |
| 359 | } |
| 360 | info.append(bk); |
| 361 | } |
| 362 | info.append(" <b>Source</b>: ") |
| 363 | .append(SourceFormat.getFormattedString(this, Globals.getSourceDisplay(), true)); |
| 364 | info.append("</html>"); |
| 365 | //TODO ListKey.KIT_TASKS |
| 366 | return info.toString(); |
| 367 | } |
| 368 | |
| 369 | private String getPreReqHTMLStrings(PlayerCharacter aPC) |
| 370 | { |
nothing calls this directly
no test coverage detected