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

Method parseToken

code/src/java/plugin/bonustokens/SpellCast.java:37–62  ·  view source on GitHub ↗
(LoadContext context, final String token)

Source from the content-addressed store, hash-verified

35 */
36
37 @Override
38 protected boolean parseToken(LoadContext context, final String token)
39 {
40 int idx = token.indexOf(Constants.LST_SEMI_LEVEL_EQUAL);
41
42 if (idx < 0)
43 {
44 idx = token.indexOf(Constants.LST_SEMI_LEVEL_DOT);
45 }
46
47 if (idx < 0)
48 {
49 if (token.equals(Constants.LST_PERCENT_LIST))
50 {
51 addBonusInfo(token);
52 return true;
53 }
54 return false;
55 }
56
57 final String level = token.substring(idx + Constants.SUBSTRING_LENGTH_SEVEN);
58
59 addBonusInfo(new SpellCastInfo(token.substring(0, idx), level));
60
61 return true;
62 }
63
64 @Override
65 protected String unparseToken(final Object obj)

Callers

nothing calls this directly

Calls 3

addBonusInfoMethod · 0.80
indexOfMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected