Search in sources :

Example 1 with PCClass

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

the class GlobalToSkillCostFacet method dataRemoved.

@Override
public void dataRemoved(DataFacetChangeEvent<CharID, PCClass> dfce) {
    CharID id = dfce.getCharID();
    PCClass cl = dfce.getCDOMObject();
    DataSetID dsID = id.getDatasetID();
    for (Skill sk : masterUsableSkillFacet.getSet(dsID)) {
        remove(id, cl, SkillCost.CROSS_CLASS, sk, masterUsableSkillFacet);
    }
    for (SkillCost cost : globalSkillCostFacet.getScopes(id)) {
        for (Skill sk : globalSkillCostFacet.getSet(id, cost)) {
            remove(id, cl, cost, sk, globalSkillCostFacet);
        }
    }
    for (SkillCost cost : globalAddedSkillCostFacet.getScopes(id)) {
        for (Skill sk : globalAddedSkillCostFacet.getSet(id, cost)) {
            remove(id, cl, cost, sk, globalAddedSkillCostFacet);
        }
    }
}
Also used : Skill(pcgen.core.Skill) SkillCost(pcgen.cdom.enumeration.SkillCost) DataSetID(pcgen.cdom.enumeration.DataSetID) PCClass(pcgen.core.PCClass) CharID(pcgen.cdom.enumeration.CharID)

Example 2 with PCClass

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

the class GlobalToSkillCostFacet method dataRemoved.

@Override
public void dataRemoved(ScopeFacetChangeEvent<CharID, SkillCost, Skill> dfce) {
    CharID id = dfce.getCharID();
    SkillCost cost = dfce.getScope();
    Skill sk = dfce.getCDOMObject();
    Object source = dfce.getSource();
    for (PCClass cl : classFacet.getSet(id)) {
        remove(id, cl, cost, sk, source);
    }
}
Also used : Skill(pcgen.core.Skill) SkillCost(pcgen.cdom.enumeration.SkillCost) PCClass(pcgen.core.PCClass) CharID(pcgen.cdom.enumeration.CharID)

Example 3 with PCClass

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

the class GlobalToSkillCostFacet method dataAdded.

@Override
public void dataAdded(DataFacetChangeEvent<CharID, PCClass> dfce) {
    CharID id = dfce.getCharID();
    PCClass cl = dfce.getCDOMObject();
    DataSetID dsID = id.getDatasetID();
    for (Skill sk : masterUsableSkillFacet.getSet(dsID)) {
        add(id, cl, SkillCost.CROSS_CLASS, sk, masterUsableSkillFacet);
    }
    for (SkillCost cost : globalSkillCostFacet.getScopes(id)) {
        for (Skill sk : globalSkillCostFacet.getSet(id, cost)) {
            add(id, cl, cost, sk, globalSkillCostFacet);
        }
    }
    for (SkillCost cost : globalAddedSkillCostFacet.getScopes(id)) {
        for (Skill sk : globalAddedSkillCostFacet.getSet(id, cost)) {
            add(id, cl, cost, sk, globalAddedSkillCostFacet);
        }
    }
}
Also used : Skill(pcgen.core.Skill) SkillCost(pcgen.cdom.enumeration.SkillCost) DataSetID(pcgen.cdom.enumeration.DataSetID) PCClass(pcgen.core.PCClass) CharID(pcgen.cdom.enumeration.CharID)

Example 4 with PCClass

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

the class FavoredClassFacet method dataAdded.

/**
	 * Identifies CDOMObjects that grant a FavoredClass and adds the granted
	 * FavoredClass to this FavoredClassFacet.
	 * 
	 * Triggered when one of the Facets to which FavoredClassFacet listens fires
	 * a DataFacetChangeEvent to indicate a CDOMObject was added to a Player
	 * Character.
	 * 
	 * @param dfce
	 *            The DataFacetChangeEvent containing the information about the
	 *            change
	 * 
	 * @see pcgen.cdom.facet.event.DataFacetChangeListener#dataAdded(pcgen.cdom.facet.event.DataFacetChangeEvent)
	 */
@Override
public void dataAdded(DataFacetChangeEvent<CharID, CDOMObject> dfce) {
    CDOMObject cdo = dfce.getCDOMObject();
    List<CDOMReference<? extends PCClass>> list = cdo.getListFor(ListKey.FAVORED_CLASS);
    if (list != null) {
        for (CDOMReference<? extends PCClass> ref : list) {
            addAll(dfce.getCharID(), ref.getContainedObjects(), cdo);
        }
    }
}
Also used : CDOMObject(pcgen.cdom.base.CDOMObject) PCClass(pcgen.core.PCClass) CDOMReference(pcgen.cdom.base.CDOMReference)

Example 5 with PCClass

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

the class ListToSkillCostFacet method dataAdded.

@Override
public void dataAdded(ScopeFacetChangeEvent<CharID, PCClass, ClassSkillList> dfce) {
    CharID id = dfce.getCharID();
    PCClass pcc = dfce.getScope();
    ClassSkillList skilllist = dfce.getCDOMObject();
    for (Skill sk : listSkillCostFacet.getSet(id, skilllist, SkillCost.CLASS)) {
        add(id, pcc, SkillCost.CLASS, sk, pcc);
    }
    for (Skill sk : listSkillCostFacet.getSet(id, skilllist, SkillCost.CROSS_CLASS)) {
        add(id, pcc, SkillCost.CROSS_CLASS, sk, pcc);
    }
}
Also used : Skill(pcgen.core.Skill) PCClass(pcgen.core.PCClass) CharID(pcgen.cdom.enumeration.CharID) ClassSkillList(pcgen.cdom.list.ClassSkillList)

Aggregations

PCClass (pcgen.core.PCClass)359 Test (org.junit.Test)96 PlayerCharacter (pcgen.core.PlayerCharacter)61 Skill (pcgen.core.Skill)55 ArrayList (java.util.ArrayList)35 Domain (pcgen.core.Domain)30 LoadContext (pcgen.rules.context.LoadContext)28 PCClassLevel (pcgen.cdom.inst.PCClassLevel)26 CDOMObject (pcgen.cdom.base.CDOMObject)23 CharacterSpell (pcgen.core.character.CharacterSpell)20 Spell (pcgen.core.spell.Spell)20 StringTokenizer (java.util.StringTokenizer)19 CharID (pcgen.cdom.enumeration.CharID)19 ClassSource (pcgen.cdom.helper.ClassSource)19 PreClassTester (plugin.pretokens.test.PreClassTester)16 SkillCost (pcgen.cdom.enumeration.SkillCost)15 ParseResult (pcgen.rules.persistence.token.ParseResult)15 Ability (pcgen.core.Ability)14 Race (pcgen.core.Race)14 BonusObj (pcgen.core.bonus.BonusObj)14