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

Method getInfo

code/src/java/pcgen/core/Kit.java:325–367  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 11

piStringMethod · 0.95
getPreReqHTMLStringsMethod · 0.95
getFormattedStringMethod · 0.95
getSourceDisplayMethod · 0.95
isEmptyMethod · 0.65
getSafeListForMethod · 0.65
equalsMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45
sortMethod · 0.45
getObjectNameMethod · 0.45

Tested by

no test coverage detected