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