Search in sources :

Example 91 with Ability

use of pcgen.core.Ability in project pcgen by PCGen.

the class QualifyTokenTest method testRoundRobinFeatSpell.

@Test
public void testRoundRobinFeatSpell() throws PersistenceLayerException {
    Ability a = primaryContext.getReferenceContext().constructCDOMObject(Ability.class, "My Feat");
    primaryContext.getReferenceContext().reassociateCategory(AbilityCategory.FEAT, a);
    a = secondaryContext.getReferenceContext().constructCDOMObject(Ability.class, "My Feat");
    secondaryContext.getReferenceContext().reassociateCategory(AbilityCategory.FEAT, a);
    primaryContext.getReferenceContext().constructCDOMObject(Spell.class, "Lightning Bolt");
    secondaryContext.getReferenceContext().constructCDOMObject(Spell.class, "Lightning Bolt");
    runRoundRobin("ABILITY=FEAT|My Feat", "SPELL|Lightning Bolt");
}
Also used : Ability(pcgen.core.Ability) Test(org.junit.Test)

Example 92 with Ability

use of pcgen.core.Ability in project pcgen by PCGen.

the class AbilityLstTest method testRoundRobinWithEqualType.

@Test
public void testRoundRobinWithEqualType() throws PersistenceLayerException {
    construct(primaryContext, "TestWP1");
    construct(primaryContext, "TestWP2");
    construct(secondaryContext, "TestWP1");
    construct(secondaryContext, "TestWP2");
    Ability a = construct(primaryContext, "Typed1");
    a.addToListFor(ListKey.TYPE, Type.getConstant("OtherTestType"));
    Ability b = construct(secondaryContext, "Typed1");
    b.addToListFor(ListKey.TYPE, Type.getConstant("OtherTestType"));
    Ability c = construct(primaryContext, "Typed2");
    c.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
    Ability d = construct(secondaryContext, "Typed2");
    d.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
    runRoundRobin("FEAT|VIRTUAL|TestWP1|TestWP2|TYPE=OtherTestType|TYPE=TestType");
}
Also used : Ability(pcgen.core.Ability) Test(org.junit.Test)

Example 93 with Ability

use of pcgen.core.Ability in project pcgen by PCGen.

the class AbilityLstTest method testRoundRobinTestEqualThree.

@Test
public void testRoundRobinTestEqualThree() throws PersistenceLayerException {
    Ability a = construct(primaryContext, "TestWP1");
    a.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
    a.addToListFor(ListKey.TYPE, Type.getConstant("TestAltType"));
    a.addToListFor(ListKey.TYPE, Type.getConstant("TestThirdType"));
    Ability b = construct(secondaryContext, "TestWP1");
    b.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
    b.addToListFor(ListKey.TYPE, Type.getConstant("TestAltType"));
    b.addToListFor(ListKey.TYPE, Type.getConstant("TestThirdType"));
    runRoundRobin("FEAT|VIRTUAL|TYPE=TestAltType.TestThirdType.TestType");
}
Also used : Ability(pcgen.core.Ability) Test(org.junit.Test)

Example 94 with Ability

use of pcgen.core.Ability in project pcgen by PCGen.

the class AbilityLstTest method testRoundRobinTestEquals.

@Test
public void testRoundRobinTestEquals() throws PersistenceLayerException {
    Ability a = construct(primaryContext, "TestWP1");
    a.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
    Ability b = construct(secondaryContext, "TestWP1");
    b.addToListFor(ListKey.TYPE, Type.getConstant("TestType"));
    runRoundRobin("FEAT|VIRTUAL|TYPE=TestType");
}
Also used : Ability(pcgen.core.Ability) Test(org.junit.Test)

Example 95 with Ability

use of pcgen.core.Ability in project pcgen by PCGen.

the class AbilityLstTest method construct.

//  
private static Ability construct(LoadContext context, String name) {
    Ability ab = context.getReferenceContext().constructCDOMObject(Ability.class, name);
    context.getReferenceContext().reassociateCategory(AbilityCategory.FEAT, ab);
    return ab;
}
Also used : Ability(pcgen.core.Ability)

Aggregations

Ability (pcgen.core.Ability)279 CNAbility (pcgen.cdom.content.CNAbility)128 AbilityCategory (pcgen.core.AbilityCategory)60 PlayerCharacter (pcgen.core.PlayerCharacter)54 Test (org.junit.Test)46 ArrayList (java.util.ArrayList)43 CNAbilitySelection (pcgen.cdom.helper.CNAbilitySelection)25 ParseResult (pcgen.rules.persistence.token.ParseResult)21 HashMapToList (pcgen.base.util.HashMapToList)15 PCClass (pcgen.core.PCClass)15 Spell (pcgen.core.spell.Spell)15 StringTokenizer (java.util.StringTokenizer)14 TestContext (plugin.lsttokens.editcontext.testsupport.TestContext)13 LoadContext (pcgen.rules.context.LoadContext)12 SpecialAbility (pcgen.core.SpecialAbility)11 CharacterSpell (pcgen.core.character.CharacterSpell)11 PreParserFactory (pcgen.persistence.lst.prereq.PreParserFactory)11 List (java.util.List)10 CDOMObject (pcgen.cdom.base.CDOMObject)10 CDOMSingleRef (pcgen.cdom.reference.CDOMSingleRef)10