Search in sources :

Example 26 with PCClassLevel

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 :)
    }
}
Also used : PCClass(pcgen.core.PCClass) PCClassLevel(pcgen.cdom.inst.PCClassLevel) Test(org.junit.Test)

Example 27 with PCClassLevel

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;
}
Also used : PCClassLevel(pcgen.cdom.inst.PCClassLevel)

Example 28 with PCClassLevel

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);
}
Also used : TestContext(plugin.lsttokens.editcontext.testsupport.TestContext) PCClassLevel(pcgen.cdom.inst.PCClassLevel) Test(org.junit.Test)

Example 29 with PCClassLevel

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);
}
Also used : TestContext(plugin.lsttokens.editcontext.testsupport.TestContext) PCClassLevel(pcgen.cdom.inst.PCClassLevel) Test(org.junit.Test)

Example 30 with PCClassLevel

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);
}
Also used : PCClassLevel(pcgen.cdom.inst.PCClassLevel)

Aggregations

PCClassLevel (pcgen.cdom.inst.PCClassLevel)69 PCClass (pcgen.core.PCClass)26 Test (org.junit.Test)25 PCLevelInfo (pcgen.core.pclevelinfo.PCLevelInfo)9 CDOMObject (pcgen.cdom.base.CDOMObject)8 ArrayList (java.util.ArrayList)5 CharID (pcgen.cdom.enumeration.CharID)5 ParseResult (pcgen.rules.persistence.token.ParseResult)5 CDOMReference (pcgen.cdom.base.CDOMReference)4 SpecialAbility (pcgen.core.SpecialAbility)4 LoadContext (pcgen.rules.context.LoadContext)4 AbstractTokenModelTest (tokenmodel.testsupport.AbstractTokenModelTest)4 StringTokenizer (java.util.StringTokenizer)3 DataFacetChangeEvent (pcgen.cdom.facet.event.DataFacetChangeEvent)3 Domain (pcgen.core.Domain)3 Skill (pcgen.core.Skill)3 TestContext (plugin.lsttokens.editcontext.testsupport.TestContext)3 BigDecimal (java.math.BigDecimal)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2