Search in sources :

Example 1 with ConsoleUIDelegate

use of pcgen.system.ConsoleUIDelegate in project pcgen by PCGen.

the class FtlMigrationTest method loadCharacter.

/**
	 * @param characterFile
	 * @return
	 */
private CharacterFacade loadCharacter(String characterFilename) {
    File file = new File(characterFilename);
    if (!PCGFile.isPCGenCharacterFile(file)) {
        Logging.errorPrint("Invalid character file specified: " + file.getAbsolutePath());
        return null;
    }
    // Load data
    UIDelegate uiDelegate = new ConsoleUIDelegate();
    SourceSelectionFacade sourcesForCharacter = CharacterManager.getRequiredSourcesForCharacter(file, uiDelegate);
    Logging.log(Logging.INFO, "Loading sources " + sourcesForCharacter.getCampaigns() + " using game mode " + sourcesForCharacter.getGameMode());
    SourceFileLoader loader = new SourceFileLoader(sourcesForCharacter, uiDelegate);
    loader.execute();
    // Load character
    CharacterFacade character = CharacterManager.openCharacter(file, uiDelegate, loader.getDataSetFacade());
    return character;
}
Also used : ConsoleUIDelegate(pcgen.system.ConsoleUIDelegate) SourceSelectionFacade(pcgen.facade.core.SourceSelectionFacade) SourceFileLoader(pcgen.persistence.SourceFileLoader) PCGFile(pcgen.io.PCGFile) File(java.io.File) CharacterFacade(pcgen.facade.core.CharacterFacade) ConsoleUIDelegate(pcgen.system.ConsoleUIDelegate) UIDelegate(pcgen.facade.core.UIDelegate)

Aggregations

File (java.io.File)1 CharacterFacade (pcgen.facade.core.CharacterFacade)1 SourceSelectionFacade (pcgen.facade.core.SourceSelectionFacade)1 UIDelegate (pcgen.facade.core.UIDelegate)1 PCGFile (pcgen.io.PCGFile)1 SourceFileLoader (pcgen.persistence.SourceFileLoader)1 ConsoleUIDelegate (pcgen.system.ConsoleUIDelegate)1