use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class PreTemplateTest method test990007_5.
/**
* Ensure a character with the requested template correctly passes
* a wildcard test
*/
public void test990007_5() {
final PlayerCharacter character = getCharacter();
final PCTemplate template = new PCTemplate();
template.setName("Half-Dragon");
Globals.getContext().getReferenceContext().importObject(template);
character.addTemplate(template);
final PCTemplate template2 = new PCTemplate();
template2.setName("Half-Celestial");
Globals.getContext().getReferenceContext().importObject(template2);
character.addTemplate(template2);
final Prerequisite prereq = new Prerequisite();
prereq.setKind("template");
prereq.setKey("half%");
prereq.setOperator(PrerequisiteOperator.GTEQ);
prereq.setOperand("1");
final boolean passes = PrereqHandler.passes(prereq, character, null);
assertTrue(passes);
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class PreTypeTest method test996803_4.
public void test996803_4() {
final PlayerCharacter character = getCharacter();
final PCTemplate template = new PCTemplate();
template.setName("Fiendish");
template.addToListFor(ListKey.TYPE, Type.getConstant("Magical-Beast"));
character.addTemplate(template);
final Prerequisite prereq = new Prerequisite();
prereq.setKind("type");
prereq.setKey("Outsider");
prereq.setOperand("1");
prereq.setOperator(PrerequisiteOperator.NEQ);
final boolean passes = PrereqHandler.passes(prereq, character, null);
assertTrue(passes);
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class PreTypeTest method test996803_1.
/**
* Ensure a character with a template correctly passes
* PRETEMPLATE
*/
public void test996803_1() {
final PlayerCharacter character = getCharacter();
final PCTemplate template = new PCTemplate();
template.setName("Half-Celestial");
template.addToListFor(ListKey.TYPE, Type.getConstant("Outsider"));
character.addTemplate(template);
final Prerequisite prereq = new Prerequisite();
prereq.setKind("type");
prereq.setKey("Outsider");
prereq.setOperand("1");
prereq.setOperator(PrerequisiteOperator.EQ);
final boolean passes = PrereqHandler.passes(prereq, character, null);
assertTrue(passes);
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class ReachFacetTest method testGetFromTemplateLowerOverridesRace.
@Test
public void testGetFromTemplateLowerOverridesRace() {
Race r = new Race();
r.put(IntegerKey.REACH, 5);
rfacet.set(id, r);
PCTemplate t = new PCTemplate();
t.put(IntegerKey.REACH, 3);
tfacet.add(id, t, this);
assertEquals(3, facet.getReach(id));
tfacet.remove(id, t, this);
assertEquals(5, facet.getReach(id));
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class SubRaceFacetTest method testUseTemplateNameFalse.
@Test
public void testUseTemplateNameFalse() {
PCTemplate pct = new PCTemplate();
pct.setName("TestTemplate");
pct.put(ObjectKey.USETEMPLATENAMEFORSUBRACE, false);
tfacet.add(id, pct, this);
assertNull(facet.getSubRace(id));
tfacet.remove(id, pct, this);
assertNull(facet.getSubRace(altid));
}
Aggregations