Search in sources :

Example 6 with CDOMDirectSingleRef

use of pcgen.cdom.reference.CDOMDirectSingleRef in project pcgen by PCGen.

the class CskillToken method process.

@Override
public boolean process(LoadContext context, PCClass obj) {
    List<CDOMReference<Skill>> list = obj.getListFor(ListKey.CLASS_SKILL);
    if (list != null) {
        ClassSkillList csl = obj.get(ObjectKey.CLASS_SKILLLIST);
        CDOMDirectSingleRef<ClassSkillList> listref = new CDOMDirectSingleRef<>(csl);
        for (CDOMReference<Skill> ref : list) {
            for (Skill sk : ref.getContainedObjects()) {
                context.getListContext().addToMasterList(getTokenName(), obj, listref, sk);
                context.commit();
            }
        }
    }
    return true;
}
Also used : Skill(pcgen.core.Skill) CDOMDirectSingleRef(pcgen.cdom.reference.CDOMDirectSingleRef) CDOMReference(pcgen.cdom.base.CDOMReference) ClassSkillList(pcgen.cdom.list.ClassSkillList)

Example 7 with CDOMDirectSingleRef

use of pcgen.cdom.reference.CDOMDirectSingleRef in project pcgen by PCGen.

the class StartingLanguageFacetTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    CDOMObject cdo1 = new PCTemplate();
    cdo1.setName("Template1");
    CDOMObject cdo2 = new Race();
    cdo2.setName("Race1");
    Language l1 = new Language();
    l1.setName("Language1");
    Language l2 = new Language();
    l2.setName("Language2");
    CDOMDirectSingleRef<Language> ref1 = new CDOMDirectSingleRef<>(l1);
    SimpleAssociatedObject apo1 = new SimpleAssociatedObject();
    cdo1.putToList(Language.STARTING_LIST, ref1, apo1);
    CDOMDirectSingleRef<Language> ref2 = new CDOMDirectSingleRef<>(l2);
    SimpleAssociatedObject apo2 = new SimpleAssociatedObject();
    cdo2.putToList(Language.STARTING_LIST, ref2, apo2);
    source = new CDOMObject[] { cdo1, cdo2 };
    target = new Language[] { l1, l2 };
}
Also used : Language(pcgen.core.Language) CDOMDirectSingleRef(pcgen.cdom.reference.CDOMDirectSingleRef) CDOMObject(pcgen.cdom.base.CDOMObject) Race(pcgen.core.Race) PCTemplate(pcgen.core.PCTemplate) SimpleAssociatedObject(pcgen.cdom.base.SimpleAssociatedObject)

Aggregations

CDOMDirectSingleRef (pcgen.cdom.reference.CDOMDirectSingleRef)7 Race (pcgen.core.Race)3 ArrayList (java.util.ArrayList)2 AssociatedPrereqObject (pcgen.cdom.base.AssociatedPrereqObject)2 CDOMObject (pcgen.cdom.base.CDOMObject)2 CDOMReference (pcgen.cdom.base.CDOMReference)2 SimpleAssociatedObject (pcgen.cdom.base.SimpleAssociatedObject)2 CompanionList (pcgen.cdom.list.CompanionList)2 CDOMSimpleSingleRef (pcgen.cdom.reference.CDOMSimpleSingleRef)2 PCTemplate (pcgen.core.PCTemplate)2 Vision (pcgen.core.Vision)2 Prerequisite (pcgen.core.prereq.Prerequisite)2 List (java.util.List)1 StringTokenizer (java.util.StringTokenizer)1 TreeSet (java.util.TreeSet)1 MapToList (pcgen.base.util.MapToList)1 TripleKeyMapToList (pcgen.base.util.TripleKeyMapToList)1 CDOMList (pcgen.cdom.base.CDOMList)1 ChooseSelectionActor (pcgen.cdom.base.ChooseSelectionActor)1 Ungranted (pcgen.cdom.base.Ungranted)1