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

Method process

code/src/java/plugin/lsttokens/ability/MultToken.java:60–96  ·  view source on GitHub ↗
(LoadContext context, Ability a)

Source from the content-addressed store, hash-verified

58 }
59
60 @Override
61 public boolean process(LoadContext context, Ability a)
62 {
63 if (a.getSafe(ObjectKey.MULTIPLE_ALLOWED))
64 {
65 if (a.get(ObjectKey.CHOOSE_INFO) == null)
66 {
67 Logging.errorPrint(
68 "Ability (" + a.getCategory() + ") " + a.getKeyName() + " had MULT:YES but no CHOOSE", context);
69 return false;
70 }
71 if (a.getKeyName().contains("("))
72 {
73 String base = AbilityUtilities.removeChoicesFromName(a.getKeyName());
74 Ability conflict =
75 context.getReferenceContext().getManufacturerId(a.getCDOMCategory()).getActiveObject(base);
76 if ((conflict != null) && conflict.getSafe(ObjectKey.MULTIPLE_ALLOWED))
77 {
78 Logging.errorPrint("Ability (" + a.getCategory() + ") " + conflict.getKeyName()
79 + " had MULT:YES which " + "prohibits Ability Key with same base "
80 + "and parenthesis, but data included: " + a.getKeyName(), context);
81 return false;
82 }
83 }
84 }
85 else
86 {
87 if (a.get(ObjectKey.CHOOSE_INFO) != null)
88 {
89 Logging.errorPrint(
90 "Ability (" + a.getCategory() + ") " + a.getKeyName() + " had MULT:NO but did have CHOOSE",
91 context);
92 return false;
93 }
94 }
95 return false;
96 }
97
98 @Override
99 public int getPriority()

Callers

nothing calls this directly

Calls 11

errorPrintMethod · 0.95
removeChoicesFromNameMethod · 0.95
getSafeMethod · 0.80
getMethod · 0.65
getKeyNameMethod · 0.65
containsMethod · 0.65
getActiveObjectMethod · 0.65
getReferenceContextMethod · 0.65
getCDOMCategoryMethod · 0.65
getCategoryMethod · 0.45
getManufacturerIdMethod · 0.45

Tested by

no test coverage detected