Search in sources :

Example 1 with EqToken

use of pcgen.io.exporttoken.EqToken in project pcgen by PCGen.

the class ExportHandler method populateTokenMap.

/**
	 * Populate the token map (if not already done so), e.g. Add all 
	 * of the types of Output Tokens to the map
	 */
private static void populateTokenMap() {
    if (!tokenMapPopulated) {
        addToTokenMap(new AbilityToken());
        addToTokenMap(new AbilityListToken());
        addToTokenMap(new BonusToken());
        addToTokenMap(new EqToken());
        addToTokenMap(new EqTypeToken());
        addToTokenMap(new GameModeToken());
        addToTokenMap(new MovementToken());
        addToTokenMap(new SkillToken());
        addToTokenMap(new SkillpointsToken());
        addToTokenMap(new StatToken());
        addToTokenMap(new TotalToken());
        addToTokenMap(new WeaponToken());
        addToTokenMap(new WeaponhToken());
        tokenMapPopulated = true;
    }
}
Also used : AbilityListToken(pcgen.io.exporttoken.AbilityListToken) SkillpointsToken(pcgen.io.exporttoken.SkillpointsToken) EqTypeToken(pcgen.io.exporttoken.EqTypeToken) MovementToken(pcgen.io.exporttoken.MovementToken) AbilityToken(pcgen.io.exporttoken.AbilityToken) SkillToken(pcgen.io.exporttoken.SkillToken) GameModeToken(pcgen.io.exporttoken.GameModeToken) WeaponhToken(pcgen.io.exporttoken.WeaponhToken) EqToken(pcgen.io.exporttoken.EqToken) BonusToken(pcgen.io.exporttoken.BonusToken) TotalToken(pcgen.io.exporttoken.TotalToken) WeaponToken(pcgen.io.exporttoken.WeaponToken) StatToken(pcgen.io.exporttoken.StatToken)

Example 2 with EqToken

use of pcgen.io.exporttoken.EqToken in project pcgen by PCGen.

the class ExportHandler method processCountEquipmentTokens.

/**
	 * Helper method for getting the variable value out of a variable string
	 * 
	 * @param vString The variable String
	 * @param aPC The PC to get the token from
	 * @return the altered variable string
	 */
private String processCountEquipmentTokens(String vString, PlayerCharacter aPC) {
    int countIndex = vString.indexOf("COUNT[EQ");
    while (countIndex >= 0) {
        char chC = vString.charAt(countIndex + 8);
        // If the character after COUNT[EQ is . or [1-9]  
        if ((chC == '.') || ((chC >= '0') && (chC <= '9'))) {
            final int i = vString.indexOf(']', countIndex + 8);
            if (i >= 0) {
                String aString = vString.substring(countIndex + 6, i);
                // Either deal with an EQTYPE or a straight EQ token
                EqToken token = null;
                if (aString.contains("EQTYPE")) {
                    token = new EqTypeToken();
                } else {
                    token = new EqToken();
                }
                String baString = token.getToken(aString, aPC, this);
                vString = vString.substring(0, countIndex) + baString + vString.substring(i + 1);
            }
        }
        countIndex = vString.indexOf("COUNT[EQ", countIndex + 1);
    }
    return vString;
}
Also used : EqToken(pcgen.io.exporttoken.EqToken) EqTypeToken(pcgen.io.exporttoken.EqTypeToken)

Aggregations

EqToken (pcgen.io.exporttoken.EqToken)2 EqTypeToken (pcgen.io.exporttoken.EqTypeToken)2 AbilityListToken (pcgen.io.exporttoken.AbilityListToken)1 AbilityToken (pcgen.io.exporttoken.AbilityToken)1 BonusToken (pcgen.io.exporttoken.BonusToken)1 GameModeToken (pcgen.io.exporttoken.GameModeToken)1 MovementToken (pcgen.io.exporttoken.MovementToken)1 SkillToken (pcgen.io.exporttoken.SkillToken)1 SkillpointsToken (pcgen.io.exporttoken.SkillpointsToken)1 StatToken (pcgen.io.exporttoken.StatToken)1 TotalToken (pcgen.io.exporttoken.TotalToken)1 WeaponToken (pcgen.io.exporttoken.WeaponToken)1 WeaponhToken (pcgen.io.exporttoken.WeaponhToken)1