use of pcgen.cdom.inst.PCClassLevel in project pcgen by PCGen.
the class ClassFacetTest method testSetClassLevelNoClass.
@Test
public void testSetClassLevelNoClass() {
PCClass t1 = new PCClass();
t1.setName("MyClass");
PCClass diff = new PCClass();
diff.setName("OtherClass");
facet.addClass(id, diff);
PCClassLevel pcl = new PCClassLevel();
pcl.put(IntegerKey.LEVEL, 3);
try {
assertFalse(facet.setClassLevel(id, t1, pcl));
} catch (CloneNotSupportedException e) {
fail(e.getMessage());
} catch (IllegalArgumentException e) {
//ok as well
}
try {
facet.getClassLevel(id, t1, 3);
fail("This should not work: PC does not have this class");
} catch (IllegalArgumentException e) {
//Yep :)
}
}
use of pcgen.cdom.inst.PCClassLevel in project pcgen by PCGen.
the class ClassLevelFacetTest method getObject.
@Override
protected PCClassLevel getObject() {
PCClassLevel wp = new PCClassLevel();
wp.setName("WP" + n++);
return wp;
}
use of pcgen.cdom.inst.PCClassLevel in project pcgen by PCGen.
the class AddIntegrationTest method testRoundRobinLevelNoReset.
@Test
public void testRoundRobinLevelNoReset() throws PersistenceLayerException {
primaryProf = new PCClassLevel();
primaryProf.put(IntegerKey.LEVEL, 1);
secondaryProf = new PCClassLevel();
secondaryProf.put(IntegerKey.LEVEL, 1);
verifyCleanStart();
TestContext tc = new TestContext();
commit(testCampaign, tc, ".CLEAR.LEVEL1");
emptyCommit(modCampaign, tc);
completeRoundRobin(tc);
}
use of pcgen.cdom.inst.PCClassLevel in project pcgen by PCGen.
the class AddIntegrationTest method testRoundRobinLevelSimple.
@Test
public void testRoundRobinLevelSimple() throws PersistenceLayerException {
primaryProf = new PCClassLevel();
primaryProf.put(IntegerKey.LEVEL, 1);
secondaryProf = new PCClassLevel();
secondaryProf.put(IntegerKey.LEVEL, 1);
verifyCleanStart();
TestContext tc = new TestContext();
commit(testCampaign, tc, ".CLEAR.LEVEL1");
commit(modCampaign, tc, ".CLEAR.LEVEL1");
completeRoundRobin(tc);
}
use of pcgen.cdom.inst.PCClassLevel in project pcgen by PCGen.
the class PCClass method doMinusLevelMods.
/*
* DELETEMETHOD I hope this can be deleted, since minus level support will not
* work the same way in the new PCClass/PCClassLevel world. If nothing else, it
* is massively a REFACTOR item to put this into the PlayerCharacter that is
* doing the removal.
*/
void doMinusLevelMods(final PlayerCharacter aPC, final int oldLevel) {
PCClassLevel pcl = aPC.getActiveClassLevel(this, oldLevel);
CDOMObjectUtilities.removeAdds(pcl, aPC);
CDOMObjectUtilities.restoreRemovals(pcl, aPC);
}
Aggregations