MCPcopy Create free account
hub / github.com/PCGen/pcgen / passes

Method passes

code/src/java/plugin/pretokens/test/PreLegsTester.java:32–49  ·  view source on GitHub ↗
(final Prerequisite prereq, final CharacterDisplay display, CDOMObject source)

Source from the content-addressed store, hash-verified

30{
31
32 @Override
33 public int passes(final Prerequisite prereq, final CharacterDisplay display, CDOMObject source)
34 throws PrerequisiteException
35 {
36 int runningTotal;
37 try
38 {
39 final int targetLegs = Integer.parseInt(prereq.getOperand());
40
41 runningTotal = prereq.getOperator().compare(display.getPreFormulaLegs(), targetLegs);
42 }
43 catch (NumberFormatException nfe)
44 {
45 throw new PrerequisiteException(
46 LanguageBundle.getFormattedString("PreLegs.error.bad_operand", prereq.getOperand()), nfe); //$NON-NLS-1$
47 }
48 return countedTotal(prereq, runningTotal);
49 }
50
51 /**
52 * Get the type of prerequisite handled by this token.

Callers

nothing calls this directly

Calls 7

getFormattedStringMethod · 0.95
parseIntMethod · 0.80
getOperandMethod · 0.80
getPreFormulaLegsMethod · 0.80
countedTotalMethod · 0.80
getOperatorMethod · 0.65
compareMethod · 0.45

Tested by

no test coverage detected