use of pcgen.cdom.base.SimpleAssociatedObject in project pcgen by PCGen.
the class PreVisionTest method testVisionNotPresentTen.
/**
* @throws Exception
*/
public void testVisionNotPresentTen() throws Exception {
final PlayerCharacter character = getCharacter();
final PCTemplate template = new PCTemplate();
final Prerequisite prereq = new Prerequisite();
prereq.setKind("vision");
prereq.setKey("darkvision");
prereq.setOperator(PrerequisiteOperator.LT);
prereq.setOperand("ANY");
boolean passes = PrereqHandler.passes(prereq, character, null);
assertTrue(passes);
template.putToList(Vision.VISIONLIST, CDOMDirectSingleRef.getRef(new Vision(VisionType.getVisionType("Darkvision"), FormulaFactory.getFormulaFor(10))), new SimpleAssociatedObject());
character.addTemplate(template);
passes = PrereqHandler.passes(prereq, character, null);
assertFalse(passes);
}
use of pcgen.cdom.base.SimpleAssociatedObject in project pcgen by PCGen.
the class PreVisionTest method testVisionZeroZero.
/**
* @throws Exception
*/
public void testVisionZeroZero() throws Exception {
final PlayerCharacter character = getCharacter();
final PCTemplate template = new PCTemplate();
final Prerequisite prereq = new Prerequisite();
prereq.setKind("vision");
prereq.setKey("darkvision");
prereq.setOperator(PrerequisiteOperator.GTEQ);
prereq.setOperand("0");
boolean passes = PrereqHandler.passes(prereq, character, null);
assertTrue(passes);
template.putToList(Vision.VISIONLIST, CDOMDirectSingleRef.getRef(new Vision(VisionType.getVisionType("Darkvision"), FormulaFactory.ZERO)), new SimpleAssociatedObject());
character.addTemplate(template);
passes = PrereqHandler.passes(prereq, character, null);
assertTrue(passes);
}
use of pcgen.cdom.base.SimpleAssociatedObject in project pcgen by PCGen.
the class PreVisionTest method testVisionFail.
/**
* @throws Exception
*/
public void testVisionFail() throws Exception {
final PlayerCharacter character = getCharacter();
final PCTemplate template = new PCTemplate();
template.putToList(Vision.VISIONLIST, CDOMDirectSingleRef.getRef(new Vision(VisionType.getVisionType("Normal"), FormulaFactory.getFormulaFor(60))), new SimpleAssociatedObject());
character.addTemplate(template);
final Prerequisite prereq = new Prerequisite();
prereq.setKind("vision");
prereq.setKey("darkvision");
prereq.setOperator(PrerequisiteOperator.GTEQ);
prereq.setOperand("30");
final boolean passes = PrereqHandler.passes(prereq, character, null);
assertFalse(passes);
}
use of pcgen.cdom.base.SimpleAssociatedObject 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