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);
}
}
}
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);
}
}
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);
}
}
}
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);
}
}
}
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);
}
}
Aggregations