use of pcgen.core.Skill in project pcgen by PCGen.
the class LocalSkillCostFacetTest method getObject.
protected Skill getObject() {
Skill t = new Skill();
t.setName("Skill" + n++);
return t;
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class LocalSkillCostFacetTest method testAddMultSkillRemove.
@Test
public void testAddMultSkillRemove() {
Skill t1 = getObject();
Skill t2 = getAltObject();
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
addCost(id, class1, t1, SkillCost.CLASS);
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t2));
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
addCost(id, class1, t2, SkillCost.CLASS);
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t2));
removeCosts(id, class1);
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t2));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class LocalSkillCostFacetTest method testAddMultCostRemove.
@Test
public void testAddMultCostRemove() {
Skill t1 = getObject();
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
addCost(id, class1, t1, SkillCost.CLASS);
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, class1, SkillCost.CROSS_CLASS, t1));
addCost(id, class1, t1, SkillCost.CROSS_CLASS);
/*
* Note behavior here that it returns what is in the database, it does
* NOT attempt to "measure" SkillCost objects
*/
assertTrue(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertTrue(getFacet().contains(id, class1, SkillCost.CROSS_CLASS, t1));
removeCosts(id, class1);
assertFalse(getFacet().contains(id, class1, SkillCost.CLASS, t1));
assertFalse(getFacet().contains(id, class1, SkillCost.CROSS_CLASS, t1));
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class ClassQualifierTokenTest method initializeObjects.
private void initializeObjects() {
s1 = new Skill();
s1.setName("s1");
primaryContext.getReferenceContext().importObject(s1);
s2 = new Skill();
s2.setName("s2");
primaryContext.getReferenceContext().importObject(s2);
primaryContext.unconditionallyProcess(s2, "TYPE", "Masterful");
s3 = new Skill();
s3.setName("s3");
primaryContext.getReferenceContext().importObject(s3);
primaryContext.unconditionallyProcess(s3, "TYPE", "Masterful");
cl1 = new PCClass();
cl1.setName("MyClass");
primaryContext.getReferenceContext().importObject(cl1);
}
use of pcgen.core.Skill in project pcgen by PCGen.
the class CrossClassQualifierTokenTest method initializeObjects.
private void initializeObjects() {
s1 = new Skill();
s1.setName("s1");
primaryContext.getReferenceContext().importObject(s1);
s2 = new Skill();
s2.setName("s2");
primaryContext.getReferenceContext().importObject(s2);
primaryContext.unconditionallyProcess(s2, "TYPE", "Masterful");
s3 = new Skill();
s3.setName("s3");
primaryContext.getReferenceContext().importObject(s3);
primaryContext.unconditionallyProcess(s3, "TYPE", "Masterful");
s4 = new Skill();
s4.setName("s4");
s4.put(ObjectKey.EXCLUSIVE, Boolean.TRUE);
primaryContext.unconditionallyProcess(s4, "TYPE", "Masterful");
primaryContext.getReferenceContext().importObject(s4);
s5 = new Skill();
s5.setName("s5");
s5.put(ObjectKey.EXCLUSIVE, Boolean.TRUE);
primaryContext.getReferenceContext().importObject(s5);
cl1 = new PCClass();
cl1.setName("MyClass");
primaryContext.getReferenceContext().importObject(cl1);
}
Aggregations