use of plugin.pretokens.parser.PreClassParser in project pcgen by PCGen.
the class PreMultTest method testCharWithMultipleSpellClasses.
/**
* Test to ensure that a character will fail a test
* if it does not have the correct number of levels
* in the class.
* @throws Exception
*/
public void testCharWithMultipleSpellClasses() throws Exception {
LoadContext context = Globals.getContext();
final PCClass pcClass = context.getReferenceContext().constructCDOMObject(PCClass.class, "MyClass");
context.unconditionallyProcess(pcClass, "SPELLSTAT", "CHA");
BuildUtilities.setFact(pcClass, "SpellType", "Arcane");
context.unconditionallyProcess(pcClass.getOriginalClassLevel(1), "CAST", "5,4");
final PCClass pcClass2 = context.getReferenceContext().constructCDOMObject(PCClass.class, "Other Class");
context.unconditionallyProcess(pcClass2, "SPELLSTAT", "INT");
BuildUtilities.setFact(pcClass2, "SpellType", "Arcane");
context.unconditionallyProcess(pcClass2.getOriginalClassLevel(1), "CAST", "5,4");
context.getReferenceContext().buildDerivedObjects();
context.getReferenceContext().resolveReferences(null);
context.loadCampaignFacets();
final PlayerCharacter character = getCharacter();
setPCStat(character, cha, 12);
setPCStat(character, intel, 12);
character.incrementClassLevel(1, pcClass);
character.incrementClassLevel(2, pcClass2);
final PreClassParser producer = new PreClassParser();
final Prerequisite prereq = producer.parse("CLASS", "1,SPELLCASTER.Arcane,SPELLCASTER.Arcane=2", false, false);
final PreMult test = new PreMult();
final int passes = test.passes(prereq, character, null);
assertEquals(1, passes);
}
use of plugin.pretokens.parser.PreClassParser in project pcgen by PCGen.
the class DomainsTokenTest method setUp.
@Override
@Before
public void setUp() throws PersistenceLayerException, URISyntaxException {
super.setUp();
TokenRegistration.register(new PreLevelParser());
TokenRegistration.register(new PreClassParser());
TokenRegistration.register(new PreLevelWriter());
TokenRegistration.register(new PreClassWriter());
}
use of plugin.pretokens.parser.PreClassParser in project pcgen by PCGen.
the class ClassesTokenTest method ltClassSetUp.
@BeforeClass
public static void ltClassSetUp() throws PersistenceLayerException {
TokenRegistration.register(new PreClassParser());
classSetUpFired = true;
}
Aggregations