Search in sources :

Example 11 with AvailableSpell

use of pcgen.cdom.helper.AvailableSpell in project pcgen by PCGen.

the class SpellListToAvailableSpellFacet method dataAdded.

@Override
public void dataAdded(DataFacetChangeEvent<CharID, CDOMList<Spell>> dfce) {
    CharID id = dfce.getCharID();
    CDOMList<Spell> list = dfce.getCDOMObject();
    Collection<AvailableSpell> spells = masterAvailableSpellFacet.getSet(id.getDatasetID());
    for (AvailableSpell as : spells) {
        if (as.getSpelllist().equals(list)) {
            add(id, as, this);
        }
    }
}
Also used : AvailableSpell(pcgen.cdom.helper.AvailableSpell) CharID(pcgen.cdom.enumeration.CharID) AvailableSpell(pcgen.cdom.helper.AvailableSpell) Spell(pcgen.core.spell.Spell)

Aggregations

AvailableSpell (pcgen.cdom.helper.AvailableSpell)11 Spell (pcgen.core.spell.Spell)6 ArrayList (java.util.ArrayList)4 AssociatedPrereqObject (pcgen.cdom.base.AssociatedPrereqObject)3 DataSetID (pcgen.cdom.enumeration.DataSetID)3 CharID (pcgen.cdom.enumeration.CharID)2 ClassSpellList (pcgen.cdom.list.ClassSpellList)2 DomainSpellList (pcgen.cdom.list.DomainSpellList)2 Prerequisite (pcgen.core.prereq.Prerequisite)2 CDOMList (pcgen.cdom.base.CDOMList)1 CDOMReference (pcgen.cdom.base.CDOMReference)1 MasterListInterface (pcgen.cdom.base.MasterListInterface)1 Domain (pcgen.core.Domain)1 InfoFacade (pcgen.facade.core.InfoFacade)1