use of pcgen.persistence.lst.GenericLoader in project pcgen by PCGen.
the class VisionTokenTest method setUp.
/*
* @see TestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
super.setUp();
final GenericLoader<PCTemplate> loader = new GenericLoader<>(PCTemplate.class);
final LoadContext context = Globals.getContext();
CampaignSourceEntry source;
try {
source = new CampaignSourceEntry(new Campaign(), new URI("file:/" + getClass().getName() + ".java"));
} catch (URISyntaxException e) {
throw new UnreachableError(e);
}
loader.parseLine(context, null, "Darkvision VISION:Darkvision (60')", source);
darkvisionT = context.getReferenceContext().silentlyGetConstructedCDOMObject(PCTemplate.class, "Darkvision");
loader.parseLine(context, null, "Low-light VISION:Low-light", source);
lowlightT = context.getReferenceContext().silentlyGetConstructedCDOMObject(PCTemplate.class, "Low-light");
loader.parseLine(context, null, "Astral VISION:Astral (130')", source);
astralT = context.getReferenceContext().silentlyGetConstructedCDOMObject(PCTemplate.class, "Astral");
assertTrue(context.getReferenceContext().resolveReferences(null));
metricUS = new UnitSet();
metricUS.setName("Metric");
metricUS.setDistanceUnit("m");
metricUS.setDistanceFactor(new BigDecimal(0.3));
metricUS.setDistanceDisplayPattern(new DecimalFormat("#.##"));
SettingsHandler.getGame().getModeContext().getReferenceContext().importObject(metricUS);
}
Aggregations