Search in sources :

Example 41 with PCTemplate

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

the class HandsFacetTest method testGetFromTemplate.

@Test
public void testGetFromTemplate() {
    rfacet.set(id, new Race());
    PCTemplate t = new PCTemplate();
    t.put(IntegerKey.CREATURE_HANDS, 5);
    tfacet.add(id, t, this);
    assertEquals(5, facet.getHands(id));
    tfacet.remove(id, t, this);
    assertEquals(2, facet.getHands(id));
}
Also used : Race(pcgen.core.Race) PCTemplate(pcgen.core.PCTemplate) Test(org.junit.Test)

Example 42 with PCTemplate

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

the class HasAnyFavoredClassFacetTest 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");
    Boolean st1 = Boolean.TRUE;
    Boolean st2 = Boolean.FALSE;
    cdo1.put(ObjectKey.ANY_FAVORED_CLASS, st1);
    cdo2.put(ObjectKey.ANY_FAVORED_CLASS, st2);
    source = new CDOMObject[] { cdo1, cdo2 };
    target = new Boolean[] { st1, st2 };
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Race(pcgen.core.Race) PCTemplate(pcgen.core.PCTemplate) PCStat(pcgen.core.PCStat)

Example 43 with PCTemplate

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

the class NaturalWeaponProfFacetTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    CDOMObject cdo1 = new PCTemplate();
    cdo1.setName("Template1");
    CDOMObject cdo2 = new Race();
    cdo2.setName("Race1");
    WeaponProf st1 = new WeaponProf();
    st1.setName("Prof1");
    WeaponProf st2 = new WeaponProf();
    st1.setName("Prof2");
    cdo1.addToListFor(ListKey.IMPLIED_WEAPONPROF, CDOMDirectSingleRef.getRef(st1));
    cdo2.addToListFor(ListKey.IMPLIED_WEAPONPROF, CDOMDirectSingleRef.getRef(st2));
    source = new CDOMObject[] { cdo1, cdo2 };
    target = new WeaponProf[] { st1, st2 };
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Race(pcgen.core.Race) WeaponProf(pcgen.core.WeaponProf) PCTemplate(pcgen.core.PCTemplate)

Example 44 with PCTemplate

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

the class ChangeProfFacetTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    CDOMObject cdo1 = new PCTemplate();
    cdo1.setName("Template1");
    CDOMObject cdo2 = new Race();
    cdo2.setName("Race1");
    ChangeProf st1 = getObject();
    ChangeProf st2 = getObject();
    cdo1.addToListFor(ListKey.CHANGEPROF, st1);
    cdo2.addToListFor(ListKey.CHANGEPROF, st2);
    source = new CDOMObject[] { cdo1, cdo2 };
    target = new ChangeProf[] { st1, st2 };
}
Also used : ChangeProf(pcgen.cdom.content.ChangeProf) CDOMObject(pcgen.cdom.base.CDOMObject) Race(pcgen.core.Race) ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) PCTemplate(pcgen.core.PCTemplate) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext)

Example 45 with PCTemplate

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

the class FavoredClassFacetTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    CDOMObject cdo1 = new PCTemplate();
    cdo1.setName("Template1");
    CDOMObject cdo2 = new Race();
    cdo2.setName("Race1");
    PCClass st1 = new PCClass();
    st1.setName("Prof1");
    PCClass st2 = new PCClass();
    st1.setName("Prof2");
    cdo1.addToListFor(ListKey.FAVORED_CLASS, CDOMDirectSingleRef.getRef(st1));
    cdo2.addToListFor(ListKey.FAVORED_CLASS, CDOMDirectSingleRef.getRef(st2));
    source = new CDOMObject[] { cdo1, cdo2 };
    target = new PCClass[] { st1, st2 };
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) Race(pcgen.core.Race) PCTemplate(pcgen.core.PCTemplate) PCClass(pcgen.core.PCClass)

Aggregations

PCTemplate (pcgen.core.PCTemplate)215 Test (org.junit.Test)105 Race (pcgen.core.Race)66 PlayerCharacter (pcgen.core.PlayerCharacter)38 CDOMObject (pcgen.cdom.base.CDOMObject)31 ArrayList (java.util.ArrayList)19 CharID (pcgen.cdom.enumeration.CharID)18 ParseResult (pcgen.rules.persistence.token.ParseResult)14 SimpleAssociatedObject (pcgen.cdom.base.SimpleAssociatedObject)13 Vision (pcgen.core.Vision)12 LoadContext (pcgen.rules.context.LoadContext)12 PCClass (pcgen.core.PCClass)11 StringTokenizer (java.util.StringTokenizer)10 VariableKey (pcgen.cdom.enumeration.VariableKey)8 DataFacetChangeEvent (pcgen.cdom.facet.event.DataFacetChangeEvent)8 Ability (pcgen.core.Ability)8 Formula (pcgen.base.formula.Formula)6 Equipment (pcgen.core.Equipment)6 PCStat (pcgen.core.PCStat)6 AbstractTokenModelTest (tokenmodel.testsupport.AbstractTokenModelTest)6