use of pcgen.persistence.lst.CampaignSourceEntry in project pcgen by PCGen.
the class SourceFileLoader method getOtherLicenses.
/**
* @return a list of licenses read from the campaign license files
*/
public Iterable<String> getOtherLicenses() {
Collection<String> licenses = new ArrayList<>();
for (CampaignSourceEntry licenseFile : licenseFiles) {
try {
StringBuilder dataBuffer = LstFileLoader.readFromURI(licenseFile.getURI());
licenses.add(dataBuffer.toString());
} catch (PersistenceLayerException e) {
Logging.errorPrint("Could not read license at " + licenseFile, e);
}
}
return licenses;
}
use of pcgen.persistence.lst.CampaignSourceEntry in project pcgen by PCGen.
the class SourceFileLoader method addDefaultEquipmentMods.
private void addDefaultEquipmentMods(LoadContext context) throws PersistenceLayerException {
URI uri = URI.create("file:/" + eqModLoader.getClass().getName() + ".java");
context.setSourceURI(uri);
SourceEntry source = new CampaignSourceEntry(new Campaign(), uri);
LoadContext subContext = context.dropIntoContext("EQUIPMENT");
String aLine;
aLine = "Add Type\tKEY:ADDTYPE\tTYPE:ALL\tCOST:0\tNAMEOPT:NONAME\tSOURCELONG:PCGen Internal\tCHOOSE:EQBUILDER.EQTYPE|COUNT=ALL|TITLE=desired TYPE(s)";
eqModLoader.parseLine(subContext, null, aLine, source);
//
// Add internal equipment modifier for adding weapon/armor types to
// equipment
//
aLine = Constants.INTERNAL_EQMOD_WEAPON + "\tTYPE:Weapon\tVISIBLE:NO\tCHOOSE:NOCHOICE\tNAMEOPT:NONAME";
eqModLoader.parseLine(subContext, null, aLine, source);
aLine = Constants.INTERNAL_EQMOD_ARMOR + "\tTYPE:Armor\tVISIBLE:NO\tCHOOSE:NOCHOICE\tNAMEOPT:NONAME";
eqModLoader.parseLine(subContext, null, aLine, source);
}
use of pcgen.persistence.lst.CampaignSourceEntry in project pcgen by PCGen.
the class SourceFileLoader method addDefaultDataControlIfNeeded.
/**
* Add default data control files to the supplied list, but only if it is empty.
*
* @param dataDefFileList The list of data control files.
*/
public static List<CampaignSourceEntry> addDefaultDataControlIfNeeded(List<CampaignSourceEntry> dataDefFileList) {
if (dataDefFileList == null) {
dataDefFileList = new ArrayList<>();
}
if (dataDefFileList.isEmpty()) {
File gameModeDir = new File(ConfigurationSettings.getSystemsDir(), "gameModes");
File defaultGameModeDir = new File(gameModeDir, "default");
File df = new File(defaultGameModeDir, "compatibilityDataControl.lst");
Campaign c = new Campaign();
c.setName("Default Data Control File");
CampaignSourceEntry cse = new CampaignSourceEntry(c, df.toURI());
dataDefFileList.add(cse);
}
return dataDefFileList;
}
use of pcgen.persistence.lst.CampaignSourceEntry in project pcgen by PCGen.
the class AbstractGlobalTokenTestCase method classSetUp.
@BeforeClass
public static void classSetUp() throws URISyntaxException {
Locale.setDefault(Locale.US);
testCampaign = new CampaignSourceEntry(new Campaign(), new URI("file:/Test%20Case"));
classSetUpFired = true;
}
use of pcgen.persistence.lst.CampaignSourceEntry in project pcgen by PCGen.
the class AbstractTokenTestCase method classSetUp.
@BeforeClass
public static void classSetUp() throws URISyntaxException {
testCampaign = new CampaignSourceEntry(new Campaign(), new URI("file:/Test%20Case"));
classSetUpFired = true;
}
Aggregations