Search in sources :

Example 6 with RaceSubType

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();
}
Also used : RaceSubType(pcgen.cdom.enumeration.RaceSubType) LevelCommandFactory(pcgen.cdom.content.LevelCommandFactory) Race(pcgen.core.Race) RaceType(pcgen.cdom.enumeration.RaceType) HtmlInfoBuilder(pcgen.gui2.util.HtmlInfoBuilder)

Aggregations

RaceSubType (pcgen.cdom.enumeration.RaceSubType)6 Race (pcgen.core.Race)3 ArrayList (java.util.ArrayList)2 StringTokenizer (java.util.StringTokenizer)2 RaceType (pcgen.cdom.enumeration.RaceType)2 LevelCommandFactory (pcgen.cdom.content.LevelCommandFactory)1 PCTemplate (pcgen.core.PCTemplate)1 HtmlInfoBuilder (pcgen.gui2.util.HtmlInfoBuilder)1