Search in sources :

Example 81 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class ShieldProfTokenTest method constructTyped.

@Override
protected CDOMObject constructTyped(LoadContext loadContext, String one) {
    CDOMObject cdo = loadContext.getReferenceContext().constructCDOMObject(Equipment.class, one);
    cdo.addToListFor(ListKey.TYPE, Type.getConstant("Shield"));
    return cdo;
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject)

Example 82 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class ShieldProficiencyTokenTest method testValidPc.

/**
	 * Check that a PC qualifier with a restriction is parsed correctly.
	 * @throws PersistenceLayerException If an error occurs.
	 */
public void testValidPc() throws PersistenceLayerException {
    CDOMObject a = (CDOMObject) construct(primaryContext, "DwarvenShield");
    a.addToListFor(ListKey.TYPE, Type.getConstant("Exotic"));
    CDOMObject c = (CDOMObject) construct(secondaryContext, "Typed1");
    c.addToListFor(ListKey.TYPE, Type.getConstant("Exotic"));
    runRoundRobin("SHIELDPROFICIENCY|PC[TYPE=Exotic]");
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject)

Example 83 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class SpellsTokenTest method testValidSubSchool.

/**
	 * Check that a SubSchool qualifier is parsed correctly.
	 * @throws PersistenceLayerException If an error occurs.
	 */
public void testValidSubSchool() throws PersistenceLayerException {
    CDOMObject a = (CDOMObject) construct(primaryContext, "Endure Elements");
    a.addToListFor(ListKey.SPELL_SUBSCHOOL, "Summoning");
    CDOMObject c = (CDOMObject) construct(secondaryContext, "Remove Curse");
    c.addToListFor(ListKey.SPELL_SUBSCHOOL, "Summoning");
    runRoundRobin("SPELLS|SUBSCHOOL=Summoning");
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject)

Example 84 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class SpellsTokenTest method testValidSchool.

/**
	 * Check that a School qualifier is parsed correctly.
	 * @throws PersistenceLayerException If an error occurs.
	 */
public void testValidSchool() throws PersistenceLayerException {
    TokenRegistration.register(new SchoolToken());
    SpellSchool schoolA = primaryContext.getReferenceContext().constructNowIfNecessary(SpellSchool.class, "Abjuration");
    SpellSchool schoolB = secondaryContext.getReferenceContext().constructNowIfNecessary(SpellSchool.class, "Abjuration");
    CDOMObject a = (CDOMObject) construct(primaryContext, "Endure Elements");
    a.addToListFor(ListKey.SPELL_SCHOOL, schoolA);
    CDOMObject c = (CDOMObject) construct(secondaryContext, "Remove Curse");
    c.addToListFor(ListKey.SPELL_SCHOOL, schoolB);
    runRoundRobin("SPELLS|SCHOOL=Abjuration");
}
Also used : SpellSchool(pcgen.cdom.identifier.SpellSchool) CDOMObject(pcgen.cdom.base.CDOMObject) SchoolToken(plugin.primitive.spell.SchoolToken) SubSchoolToken(plugin.primitive.spell.SubSchoolToken)

Example 85 with CDOMObject

use of pcgen.cdom.base.CDOMObject in project pcgen by PCGen.

the class SpellListKnownToken method getToken.

/**
	 * @see pcgen.io.exporttoken.Token#getToken(java.lang.String, pcgen.core.PlayerCharacter, pcgen.io.ExportHandler)
	 */
@Override
public String getToken(String tokenSource, PlayerCharacter pc, ExportHandler eh) {
    StringBuilder retValue = new StringBuilder();
    SpellListTokenParams params = new SpellListTokenParams(tokenSource, SpellListToken.SPELLTAG_KNOWN);
    final CDOMObject aObject = pc.getSpellClassAtIndex(params.getClassNum());
    if (aObject != null) {
        retValue.append(Integer.toString(getKnownNum(aObject, params.getLevel(), pc)));
    }
    return retValue.toString();
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject)

Aggregations

CDOMObject (pcgen.cdom.base.CDOMObject)235 Test (org.junit.Test)68 CharID (pcgen.cdom.enumeration.CharID)53 PCTemplate (pcgen.core.PCTemplate)30 ArrayList (java.util.ArrayList)22 PCClass (pcgen.core.PCClass)18 DataFacetChangeEvent (pcgen.cdom.facet.event.DataFacetChangeEvent)17 Race (pcgen.core.Race)17 Equipment (pcgen.core.Equipment)15 PlayerCharacter (pcgen.core.PlayerCharacter)15 Map (java.util.Map)14 AssociatedPrereqObject (pcgen.cdom.base.AssociatedPrereqObject)14 CDOMReference (pcgen.cdom.base.CDOMReference)14 BonusObj (pcgen.core.bonus.BonusObj)14 IdentityHashMap (java.util.IdentityHashMap)12 Set (java.util.Set)12 VariableKey (pcgen.cdom.enumeration.VariableKey)11 HashMap (java.util.HashMap)10 CNAbility (pcgen.cdom.content.CNAbility)10 Spell (pcgen.core.spell.Spell)9