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

Method passes

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

Source from the content-addressed store, hash-verified

32{
33
34 @Override
35 public int passes(final Prerequisite prereq, final PlayerCharacter display, CDOMObject source)
36 throws PrerequisiteException
37 {
38 int runningTotal;
39 try
40 {
41 final int targetHands = Integer.parseInt(prereq.getOperand());
42
43 int hands = FacetLibrary.getFacet(HandsFacet.class).getHands(display.getCharID());
44
45 runningTotal = prereq.getOperator().compare(hands, targetHands);
46 }
47 catch (NumberFormatException nfe)
48 {
49 throw new PrerequisiteException(
50 LanguageBundle.getFormattedString("PreHands.error.badly_formed", prereq.getOperand()), nfe); //$NON
51 // -NLS-1$
52 }
53 return countedTotal(prereq, runningTotal);
54 }
55
56 /**
57 * 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
getHandsMethod · 0.80
countedTotalMethod · 0.80
getCharIDMethod · 0.65
getOperatorMethod · 0.65
compareMethod · 0.45

Tested by

no test coverage detected