Search in sources :

Example 1 with PCGVer2Creator

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

the class AbstractSaveRestoreTest method runWriteRead.

protected void runWriteRead(boolean dump) {
    GameMode mode = SettingsHandler.getGame();
    String pcgString = (new PCGVer2Creator(pc, mode, null)).createPCGString();
    if (dump)
        System.err.println(pcgString);
    InputStream is = new ByteArrayInputStream(pcgString.getBytes());
    PCGIOHandler ioh = new PCGIOHandler();
    ioh.read(reloadedPC, is, true);
    assertEquals(ioh.getErrors().toString(), 0, ioh.getErrors().size());
    assertEquals(ioh.getWarnings().toString(), 0, ioh.getWarnings().size());
}
Also used : GameMode(pcgen.core.GameMode) PCGIOHandler(pcgen.io.PCGIOHandler) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) PCGVer2Creator(pcgen.io.PCGVer2Creator)

Example 2 with PCGVer2Creator

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

the class AbstractSaveRestoreTest method dumpPC.

protected void dumpPC(PlayerCharacter plchar) {
    GameMode mode = SettingsHandler.getGame();
    String pcgString = (new PCGVer2Creator(plchar, mode, null)).createPCGString();
    System.err.println(pcgString);
}
Also used : GameMode(pcgen.core.GameMode) PCGVer2Creator(pcgen.io.PCGVer2Creator)

Aggregations

GameMode (pcgen.core.GameMode)2 PCGVer2Creator (pcgen.io.PCGVer2Creator)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 PCGIOHandler (pcgen.io.PCGIOHandler)1