use of pcgen.cdom.enumeration.RaceSubType in project pcgen by PCGen.
the class Gui2InfoFactory method getHTMLInfo.
/**
* @see pcgen.core.facade.InfoFactory#getHTMLInfo(pcgen.core.facade.RaceFacade)
*/
@Override
public String getHTMLInfo(RaceFacade raceFacade) {
if (!(raceFacade instanceof Race)) {
return EMPTY_STRING;
}
Race race = (Race) raceFacade;
final HtmlInfoBuilder infoText = new HtmlInfoBuilder();
if (!race.getKeyName().startsWith("<none")) {
infoText.appendTitleElement(OutputNameFormatting.piString(race, false));
infoText.appendLineBreak();
RaceType rt = race.get(ObjectKey.RACETYPE);
if (rt != null) {
//$NON-NLS-1$
infoText.appendI18nElement("in_irInfoRaceType", rt.toString());
}
List<RaceSubType> rst = race.getListFor(ListKey.RACESUBTYPE);
if (rst != null) {
infoText.appendSpacer();
//$NON-NLS-1$
infoText.appendI18nElement("in_irInfoSubType", StringUtil.join(rst, ", "));
}
if (!race.getType().isEmpty()) {
infoText.appendSpacer();
//$NON-NLS-1$
infoText.appendI18nElement("in_irInfoType", race.getType());
}
appendFacts(infoText, race);
infoText.appendLineBreak();
String size = race.getSize();
if (StringUtils.isNotEmpty(size)) {
//$NON-NLS-1$
infoText.appendI18nElement("in_size", size);
}
String movement = getMovement(raceFacade);
if (!movement.isEmpty()) {
infoText.appendSpacer();
//$NON-NLS-1$
infoText.appendI18nElement("in_movement", movement);
}
String vision = getVision(raceFacade);
if (!vision.isEmpty()) {
infoText.appendSpacer();
//$NON-NLS-1$
infoText.appendI18nElement("in_vision", vision);
}
String bString = PrerequisiteUtilities.preReqHTMLStringsForList(pc, null, race.getPrerequisiteList(), false);
if (!bString.isEmpty()) {
infoText.appendLineBreak();
//$NON-NLS-1$
infoText.appendI18nElement("in_requirements", bString);
}
String desc = pc.getDescription(race);
if (!desc.isEmpty()) {
infoText.appendLineBreak();
//$NON-NLS-1$
infoText.appendI18nFormattedElement(//$NON-NLS-1$
"in_InfoDescription", DescriptionFormatting.piWrapDesc(race, desc, false));
}
String statAdjustments = getStatAdjustments(raceFacade);
if (StringUtils.isNotEmpty(statAdjustments)) {
infoText.appendLineBreak();
//$NON-NLS-1$
infoText.appendI18nElement("in_irTableStat", statAdjustments);
}
LevelCommandFactory levelCommandFactory = race.get(ObjectKey.MONSTER_CLASS);
if (levelCommandFactory != null) {
infoText.appendLineBreak();
//$NON-NLS-1$
infoText.appendI18nFormattedElement(//$NON-NLS-1$
"in_irInfoMonsterClass", String.valueOf(levelCommandFactory.getLevelCount()), OutputNameFormatting.piString(levelCommandFactory.getPCClass(), false));
}
String favoredClass = getFavoredClass(raceFacade);
if (StringUtils.isNotEmpty(favoredClass)) {
infoText.appendLineBreak();
//$NON-NLS-1$
infoText.appendI18nElement("in_favoredClass", favoredClass);
}
bString = race.getSource();
if (!bString.isEmpty()) {
infoText.appendLineBreak();
//$NON-NLS-1$
infoText.appendI18nElement("in_sourceLabel", bString);
}
}
return infoText.toString();
}
Aggregations