Search in sources :

Example 1 with CcskillToken

use of plugin.lsttokens.domain.CcskillToken in project pcgen by PCGen.

the class DomainTargetSaveRestoreTest method testDomainCCSkill.

@Test
public void testDomainCCSkill() {
    Skill granted = create(Skill.class, "Granted");
    new ExclusiveToken().parseToken(context, granted, "Yes");
    Domain target = create(getObjectClass(), "Target");
    create(Skill.class, "MySkill");
    new CcskillToken().parseToken(context, target, "LIST");
    new SkillToken().parseToken(context, target, "Granted|MySkill");
    Object o = prepare(target);
    finishLoad();
    applyObject(target);
    PCClass myclass = pc.getClassKeyed("MyClass");
    assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(granted, myclass));
    runRoundRobin(getPreEqualityCleanup());
    assertEquals(SkillCost.CROSS_CLASS, pc.getSkillCostForClass(granted, myclass));
    myclass = reloadedPC.getClassKeyed("MyClass");
    assertEquals(SkillCost.CROSS_CLASS, reloadedPC.getSkillCostForClass(granted, myclass));
    remove(o);
    reloadedPC.setDirty(true);
    assertEquals(SkillCost.EXCLUSIVE, reloadedPC.getSkillCostForClass(granted, myclass));
}
Also used : Skill(pcgen.core.Skill) CcskillToken(plugin.lsttokens.domain.CcskillToken) ExclusiveToken(plugin.lsttokens.skill.ExclusiveToken) Domain(pcgen.core.Domain) PCClass(pcgen.core.PCClass) SkillToken(plugin.lsttokens.choose.SkillToken) AbstractGlobalTargetedSaveRestoreTest(pcgen.io.testsupport.AbstractGlobalTargetedSaveRestoreTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Domain (pcgen.core.Domain)1 PCClass (pcgen.core.PCClass)1 Skill (pcgen.core.Skill)1 AbstractGlobalTargetedSaveRestoreTest (pcgen.io.testsupport.AbstractGlobalTargetedSaveRestoreTest)1 SkillToken (plugin.lsttokens.choose.SkillToken)1 CcskillToken (plugin.lsttokens.domain.CcskillToken)1 ExclusiveToken (plugin.lsttokens.skill.ExclusiveToken)1