use of pcgen.io.exporttoken.EqTypeToken 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;
}
}
use of pcgen.io.exporttoken.EqTypeToken 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;
}
Aggregations