use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class LegsFacetTest method testGetFromTemplate.
@Test
public void testGetFromTemplate() {
rfacet.set(id, new Race());
PCTemplate t = new PCTemplate();
t.put(IntegerKey.LEGS, 5);
tfacet.add(id, t, this);
assertEquals(5, facet.getLegs(id));
tfacet.remove(id, t, this);
assertEquals(2, facet.getLegs(id));
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class MovementFacetTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
CDOMObject cdo1 = new PCTemplate();
cdo1.setName("Templ");
CDOMObject cdo2 = new Race();
cdo2.setName("Race");
PCStat pcs1 = new PCStat();
pcs1.setName("Stat1");
PCStat pcs2 = new PCStat();
pcs2.setName("Stat2");
Movement st1 = new Movement(1);
Movement st2 = new Movement(1);
cdo1.addToListFor(ListKey.MOVEMENT, st1);
cdo2.addToListFor(ListKey.MOVEMENT, st2);
source = new CDOMObject[] { cdo1, cdo2 };
target = new Movement[] { st1, st2 };
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class NonProficiencyPenaltyFacetTest method testWithNothingInTemplates.
@Test
public void testWithNothingInTemplates() {
tfacet.add(id, new PCTemplate(), this);
assertEquals(SettingsHandler.getGame().getNonProfPenalty(), facet.getPenalty(id));
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class NonProficiencyPenaltyFacetTest method testMultipleGenderSetSecondDominatesGender.
@Test
public void testMultipleGenderSetSecondDominatesGender() {
PCTemplate pct = new PCTemplate();
pct.setName("PCT");
pct.put(IntegerKey.NONPP, -2);
tfacet.add(id, pct, this);
assertEquals(-2, facet.getPenalty(id));
PCTemplate pct2 = new PCTemplate();
pct2.setName("Other");
pct2.put(IntegerKey.NONPP, -3);
tfacet.add(id, pct2, this);
assertEquals(-3, facet.getPenalty(id));
tfacet.remove(id, pct, this);
assertEquals(-3, facet.getPenalty(id));
tfacet.add(id, pct, this);
assertEquals(-2, facet.getPenalty(id));
tfacet.remove(id, pct, this);
assertEquals(-3, facet.getPenalty(id));
tfacet.remove(id, pct2, this);
assertEquals(SettingsHandler.getGame().getNonProfPenalty(), facet.getPenalty(id));
}
use of pcgen.core.PCTemplate in project pcgen by PCGen.
the class HandsFacetTest method testGetFromTemplateSecondOverrides.
@Test
public void testGetFromTemplateSecondOverrides() {
Race r = new Race();
r.put(IntegerKey.CREATURE_HANDS, 5);
rfacet.set(id, r);
assertEquals(5, facet.getHands(id));
PCTemplate t = new PCTemplate();
t.setName("PCT");
t.put(IntegerKey.CREATURE_HANDS, 3);
tfacet.add(id, t, this);
assertEquals(3, facet.getHands(id));
PCTemplate t5 = new PCTemplate();
t5.setName("Other");
t5.put(IntegerKey.CREATURE_HANDS, 4);
tfacet.add(id, t5, this);
assertEquals(4, facet.getHands(id));
tfacet.remove(id, t, this);
assertEquals(4, facet.getHands(id));
tfacet.add(id, t, this);
assertEquals(3, facet.getHands(id));
tfacet.remove(id, t, this);
assertEquals(4, facet.getHands(id));
tfacet.remove(id, t5, this);
assertEquals(5, facet.getHands(id));
}
Aggregations