use of pcgen.core.PCCheck in project pcgen by PCGen.
the class PreCheckTester method passes.
/**
* @see pcgen.core.prereq.PrerequisiteTest#passes(pcgen.core.prereq.Prerequisite, pcgen.core.PlayerCharacter)
*/
@Override
public int passes(final Prerequisite prereq, final PlayerCharacter character, CDOMObject source) {
int runningTotal = 0;
final String checkName = prereq.getKey();
//$NON-NLS-1$
final int operand = character.getVariableValue(prereq.getOperand(), "").intValue();
PCCheck check = Globals.getContext().getReferenceContext().silentlyGetConstructedCDOMObject(PCCheck.class, checkName);
if (check != null) {
final int characterCheckBonus = character.getTotalCheck(check);
runningTotal = prereq.getOperator().compare(characterCheckBonus, operand) > 0 ? 1 : 0;
}
return countedTotal(prereq, runningTotal);
}
Aggregations