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

Method passes

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

Source from the content-addressed store, hash-verified

32{
33
34 @Override
35 public int passes(final Prerequisite prereq, final CharacterDisplay display, CDOMObject source)
36 throws PrerequisiteException
37 {
38 int runningTotal;
39 try
40 {
41 final int targetReach = Integer.parseInt(prereq.getOperand());
42
43 int pcReach = FacetLibrary.getFacet(ReachFacet.class).getReach(display.getCharID());
44 runningTotal = prereq.getOperator().compare(pcReach, targetReach);
45 }
46 catch (NumberFormatException nfe)
47 {
48 throw new PrerequisiteException(
49 LanguageBundle.getFormattedString("PreReach.error.badly_formed", prereq.getOperand()), nfe);
50 }
51 return countedTotal(prereq, runningTotal);
52 }
53
54 /**
55 * Get the type of prerequisite handled by this token.

Callers

nothing calls this directly

Calls 9

getFacetMethod · 0.95
getFormattedStringMethod · 0.95
parseIntMethod · 0.80
getOperandMethod · 0.80
getReachMethod · 0.80
countedTotalMethod · 0.80
getCharIDMethod · 0.65
getOperatorMethod · 0.65
compareMethod · 0.45

Tested by

no test coverage detected