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

Method getAbilitiesFromPrereq

code/src/java/pcgen/core/DataSet.java:290–315  ·  view source on GitHub ↗
(Prerequisite prereq, Category<Ability> cat)

Source from the content-addressed store, hash-verified

288 }
289
290 private List<AbilityFacade> getAbilitiesFromPrereq(Prerequisite prereq, Category<Ability> cat)
291 {
292 List<AbilityFacade> prereqList = new ArrayList<>();
293 // Exclude negated prereqs
294 if (prereq == null || (prereq.getOperator() == PrerequisiteOperator.LT && "1".equals(prereq.getOperand())))
295 {
296 return prereqList;
297 }
298
299 if ("FEAT".equalsIgnoreCase(prereq.getKind()) || "ABILITY".equalsIgnoreCase(prereq.getKind()))
300 {
301 Ability ability =
302 Globals.getContext().getReferenceContext().getManufacturerId(cat).getObject(prereq.getKey());
303 if (ability != null)
304 {
305 prereqList.add(ability);
306 }
307 }
308
309 for (Prerequisite childPrereq : prereq.getPrerequisites())
310 {
311 prereqList.addAll(getAbilitiesFromPrereq(childPrereq, cat));
312 }
313
314 return prereqList;
315 }
316
317 @Override
318 public ListFacade<Skill> getSkills()

Callers 1

getPrereqAbilitiesMethod · 0.95

Calls 13

getContextMethod · 0.95
getOperandMethod · 0.80
equalsIgnoreCaseMethod · 0.80
getKindMethod · 0.80
getOperatorMethod · 0.65
equalsMethod · 0.65
getObjectMethod · 0.65
getReferenceContextMethod · 0.65
getKeyMethod · 0.65
addMethod · 0.65
addAllMethod · 0.65
getManufacturerIdMethod · 0.45

Tested by

no test coverage detected