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;
}
Aggregations