Search in sources :

Example 31 with DataSetID

use of pcgen.cdom.enumeration.DataSetID in project pcgen by PCGen.

the class VariableFacetTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    DataSetID cid = DataSetID.getID();
    id = CharID.getID(cid);
    altid = CharID.getID(cid);
}
Also used : DataSetID(pcgen.cdom.enumeration.DataSetID)

Example 32 with DataSetID

use of pcgen.cdom.enumeration.DataSetID in project pcgen by PCGen.

the class HeightFacetTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    DataSetID cid = DataSetID.getID();
    id = CharID.getID(cid);
}
Also used : DataSetID(pcgen.cdom.enumeration.DataSetID)

Example 33 with DataSetID

use of pcgen.cdom.enumeration.DataSetID in project pcgen by PCGen.

the class MasterAvailableSpellFacet method initialize.

/**
	 * Initializes the global lists of ClassSkillLists. This method only needs
	 * to be called once for each set of sources that are loaded.
	 */
@Override
public synchronized void initialize(LoadContext lc) {
    DataSetID dsID = lc.getDataSetID();
    MasterListInterface masterLists = SettingsHandler.getGame().getMasterLists();
    List<CDOMReference<CDOMList<Spell>>> useLists = new ArrayList<>();
    for (CDOMReference ref : masterLists.getActiveLists()) {
        Collection<CDOMList<Spell>> lists = ref.getContainedObjects();
        for (CDOMList<Spell> list : lists) {
            if ((list instanceof ClassSpellList) || (list instanceof DomainSpellList)) {
                useLists.add(ref);
                break;
            }
        }
    }
    for (CDOMReference<CDOMList<Spell>> ref : useLists) {
        for (Spell spell : masterLists.getObjects(ref)) {
            Collection<AssociatedPrereqObject> assoc = masterLists.getAssociations(ref, spell);
            for (AssociatedPrereqObject apo : assoc) {
                int lvl = apo.getAssociation(AssociationKey.SPELL_LEVEL);
                for (CDOMList<Spell> list : ref.getContainedObjects()) {
                    AvailableSpell as = new AvailableSpell(list, spell, lvl);
                    if (apo.hasPrerequisites()) {
                        as.addAllPrerequisites(apo.getPrerequisiteList());
                    }
                    add(dsID, as);
                }
            }
        }
    }
}
Also used : ArrayList(java.util.ArrayList) ClassSpellList(pcgen.cdom.list.ClassSpellList) DataSetID(pcgen.cdom.enumeration.DataSetID) AvailableSpell(pcgen.cdom.helper.AvailableSpell) Spell(pcgen.core.spell.Spell) DomainSpellList(pcgen.cdom.list.DomainSpellList) AvailableSpell(pcgen.cdom.helper.AvailableSpell) MasterListInterface(pcgen.cdom.base.MasterListInterface) CDOMList(pcgen.cdom.base.CDOMList) CDOMReference(pcgen.cdom.base.CDOMReference) AssociatedPrereqObject(pcgen.cdom.base.AssociatedPrereqObject)

Example 34 with DataSetID

use of pcgen.cdom.enumeration.DataSetID in project pcgen by PCGen.

the class SolverFactoryFacet method initialize.

@Override
public synchronized void initialize(LoadContext context) {
    DataSetID dsID = context.getDataSetID();
    set(dsID, context.getVariableContext().getFormulaSetup().getSolverFactory());
}
Also used : DataSetID(pcgen.cdom.enumeration.DataSetID)

Example 35 with DataSetID

use of pcgen.cdom.enumeration.DataSetID in project pcgen by PCGen.

the class FormulaSetupFacet method initialize.

@Override
public synchronized void initialize(LoadContext context) {
    DataSetID dsID = context.getDataSetID();
    SplitFormulaSetup formulaSetup = context.getVariableContext().getFormulaSetup();
    set(dsID, formulaSetup);
}
Also used : SplitFormulaSetup(pcgen.base.solver.SplitFormulaSetup) DataSetID(pcgen.cdom.enumeration.DataSetID)

Aggregations

DataSetID (pcgen.cdom.enumeration.DataSetID)37 PCClass (pcgen.core.PCClass)5 AvailableSpell (pcgen.cdom.helper.AvailableSpell)3 Skill (pcgen.core.Skill)3 CharID (pcgen.cdom.enumeration.CharID)2 SkillCost (pcgen.cdom.enumeration.SkillCost)2 FormulaResolvingFacet (pcgen.cdom.facet.FormulaResolvingFacet)2 ClassSpellList (pcgen.cdom.list.ClassSpellList)2 DomainSpellList (pcgen.cdom.list.DomainSpellList)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 VariableLibrary (pcgen.base.formula.base.VariableLibrary)1 SplitFormulaSetup (pcgen.base.solver.SplitFormulaSetup)1 AssociatedPrereqObject (pcgen.cdom.base.AssociatedPrereqObject)1 CDOMList (pcgen.cdom.base.CDOMList)1 CDOMReference (pcgen.cdom.base.CDOMReference)1 MasterListInterface (pcgen.cdom.base.MasterListInterface)1 CNAbility (pcgen.cdom.content.CNAbility)1 NonAbilityFacet (pcgen.cdom.facet.analysis.NonAbilityFacet)1 NonStatStatFacet (pcgen.cdom.facet.analysis.NonStatStatFacet)1