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

Method initialize

code/src/java/plugin/qualifier/skill/RanksToken.java:88–127  ·  view source on GitHub ↗
(LoadContext context, SelectionCreator<Skill> sc, String condition, String value,
		boolean negate)

Source from the content-addressed store, hash-verified

86 }
87
88 @Override
89 public boolean initialize(LoadContext context, SelectionCreator<Skill> sc, String condition, String value,
90 boolean negate)
91 {
92 if (condition == null)
93 {
94 Logging.addParseMessage(Level.SEVERE,
95 getTokenName() + " Must be a conditional Qualifier, e.g. " + getTokenName() + "=10");
96 return false;
97 }
98 try
99 {
100 ranks = Integer.parseInt(condition);
101 }
102 catch (NumberFormatException e)
103 {
104 if (MAXRANK.equalsIgnoreCase(condition))
105 {
106 maxRank = true;
107 }
108 else
109 {
110 Logging.addParseMessage(Level.SEVERE,
111 getTokenName() + " Must be a numerical conditional Qualifier, e.g. " + getTokenName()
112 + "=10 ... Offending value: " + condition);
113 return false;
114 }
115 }
116 negated = negate;
117 if (value == null)
118 {
119 pcs = sc.getAllReference();
120 }
121 else
122 {
123 pcs = context.getPrimitiveChoiceFilter(sc, value);
124 wasRestricted = true;
125 }
126 return pcs != null;
127 }
128
129 @Override
130 public GroupingState getGroupingState()

Callers

nothing calls this directly

Calls 6

addParseMessageMethod · 0.95
getTokenNameMethod · 0.95
parseIntMethod · 0.80
equalsIgnoreCaseMethod · 0.80
getAllReferenceMethod · 0.65

Tested by

no test coverage detected