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

Method passes

code/src/java/plugin/pretokens/test/PreTypeTester.java:53–84  ·  view source on GitHub ↗
(final Prerequisite prereq, final Equipment equipment, CharacterDisplay display)

Source from the content-addressed store, hash-verified

51 }
52
53 @Override
54 public int passes(final Prerequisite prereq, final Equipment equipment, CharacterDisplay display)
55 throws PrerequisiteException
56 {
57
58 final String requiredType = prereq.getKey();
59 int runningTotal = 0;
60
61 if (prereq.getOperator().equals(PrerequisiteOperator.EQ))
62 {
63 if (equipment.isPreType(requiredType))
64 {
65 runningTotal++;
66 }
67 }
68 else if (prereq.getOperator().equals(PrerequisiteOperator.NEQ))
69 {
70 if (!equipment.isPreType(requiredType))
71 {
72 runningTotal++;
73 }
74 }
75 else
76 {
77 throw new PrerequisiteException(
78 LanguageBundle.getFormattedString("PreType.error.invalidComparison", //$NON-NLS-1$
79 prereq.getOperator().toString(), prereq.toString()));
80 }
81
82 runningTotal = countedTotal(prereq, runningTotal);
83 return runningTotal;
84 }
85
86 @Override
87 public int passes(final Prerequisite prereq, final CharacterDisplay display, CDOMObject source)

Callers

nothing calls this directly

Calls 13

getFormattedStringMethod · 0.95
errorPrintMethod · 0.95
getTypesMethod · 0.95
isPreTypeMethod · 0.80
countedTotalMethod · 0.80
parseIntMethod · 0.80
getOperandMethod · 0.80
equalsIgnoreCaseMethod · 0.80
getKeyMethod · 0.65
equalsMethod · 0.65
getOperatorMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected