Search in sources :

Example 16 with ExportHandler

use of pcgen.io.ExportHandler in project pcgen by PCGen.

the class BioTokenTest method evaluateToken.

private String evaluateToken(String token, PlayerCharacter pc) throws IOException {
    StringWriter retWriter = new StringWriter();
    BufferedWriter bufWriter = new BufferedWriter(retWriter);
    ExportHandler export = new ExportHandler(new File(""));
    export.replaceTokenSkipMath(pc, token, bufWriter);
    retWriter.flush();
    bufWriter.flush();
    return retWriter.toString();
}
Also used : StringWriter(java.io.StringWriter) ExportHandler(pcgen.io.ExportHandler) File(java.io.File) BufferedWriter(java.io.BufferedWriter)

Example 17 with ExportHandler

use of pcgen.io.ExportHandler in project pcgen by PCGen.

the class VAbilityTokenTest method testAspectCount.

/**
	 * Tests the ASPECTCOUNT subtoken of VABILITY.
	 */
public void testAspectCount() {
    VAbilityToken tok = new VAbilityToken();
    ExportHandler eh = new ExportHandler(null);
    PlayerCharacter character = getCharacter();
    assertEquals("5", tok.getToken("VABILITY.FEAT.0.ASPECTCOUNT", character, eh));
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter) ExportHandler(pcgen.io.ExportHandler)

Example 18 with ExportHandler

use of pcgen.io.ExportHandler in project pcgen by PCGen.

the class VAbilityTokenTest method testAspect.

/**
	 * Tests the aspect subtoken of VABILITY without a specific aspect.
	 */
public void testAspect() {
    VAbilityToken tok = new VAbilityToken();
    ExportHandler eh = new ExportHandler(null);
    PlayerCharacter character = getCharacter();
    assertEquals("Age In Years: 2000, Colour: Green, Shape: Icosahedron, Sides: 20, Size: L", tok.getToken("VABILITY.FEAT.0.ASPECT", character, eh));
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter) ExportHandler(pcgen.io.ExportHandler)

Example 19 with ExportHandler

use of pcgen.io.ExportHandler in project pcgen by PCGen.

the class VAbilityTokenTest method testKey.

/**
	 * Tests the key subtoken of VABILITY.
	 */
public void testKey() {
    VAbilityToken tok = new VAbilityToken();
    ExportHandler eh = new ExportHandler(null);
    PlayerCharacter character = getCharacter();
    assertEquals("KEY_Perform (Dance)", tok.getToken("VABILITY.FEAT.0.KEY", character, eh));
    assertEquals("KEY_Skill Focus", tok.getToken("VABILITY.FEAT.1.KEY", character, eh));
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter) ExportHandler(pcgen.io.ExportHandler)

Example 20 with ExportHandler

use of pcgen.io.ExportHandler in project pcgen by PCGen.

the class VAbilityTokenTest method testHasAspect.

/**
	 * Tests the HASASPECT subtoken of VABILITY.
	 */
public void testHasAspect() {
    VAbilityToken tok = new VAbilityToken();
    ExportHandler eh = new ExportHandler(null);
    PlayerCharacter character = getCharacter();
    assertEquals("N", tok.getToken("VABILITY.FEAT.0.HASASPECT.3", character, eh));
    assertEquals("N", tok.getToken("VABILITY.FEAT.0.HASASPECT.5", character, eh));
    assertEquals("N", tok.getToken("VABILITY.FEAT.0.HASASPECT.Attack Type", character, eh));
    assertEquals("Y", tok.getToken("VABILITY.FEAT.0.HASASPECT.Colour", character, eh));
    assertEquals("Y", tok.getToken("VABILITY.FEAT.0.HASASPECT.Age In Years", character, eh));
}
Also used : PlayerCharacter(pcgen.core.PlayerCharacter) ExportHandler(pcgen.io.ExportHandler)

Aggregations

ExportHandler (pcgen.io.ExportHandler)31 PlayerCharacter (pcgen.core.PlayerCharacter)24 File (java.io.File)7 BufferedWriter (java.io.BufferedWriter)6 StringWriter (java.io.StringWriter)4 IOException (java.io.IOException)3 TextToken (plugin.exporttokens.TextToken)3 OutputStreamWriter (java.io.OutputStreamWriter)2 Test (org.junit.Test)2 FileOutputStream (java.io.FileOutputStream)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 CharacterFacade (pcgen.facade.core.CharacterFacade)1 ExportException (pcgen.io.ExportException)1 PCGFile (pcgen.io.PCGFile)1