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

Method getLevels

code/src/java/pcgen/cdom/helper/SpellLevelInfo.java:58–77  ·  view source on GitHub ↗
(PlayerCharacter pc)

Source from the content-addressed store, hash-verified

56 }
57
58 public Collection<SpellLevel> getLevels(PlayerCharacter pc)
59 {
60 List<SpellLevel> list = new ArrayList<>();
61 Converter<PCClass, PCClass> conv = new AddFilterConverter<>(new DereferencingConverter<>(pc), this);
62 for (PCClass cl : filter.getCollection(pc, conv))
63 {
64 int min = minimumLevel.resolve(pc, cl.getQualifiedKey()).intValue();
65 int max = maximumLevel.resolve(pc, cl.getQualifiedKey()).intValue();
66 if (min > max)
67 {
68 Logging.errorPrint("Resolved Minimum: " + min + " (from " + minimumLevel
69 + ") was greater than resolved Maximum: " + max + " (from " + maximumLevel + ")");
70 }
71 for (int i = min; i <= max; ++i)
72 {
73 list.add(new SpellLevel(cl, i));
74 }
75 }
76 return list;
77 }
78
79 @Override
80 public boolean allow(PlayerCharacter pc, PCClass cl)

Callers

nothing calls this directly

Calls 6

errorPrintMethod · 0.95
intValueMethod · 0.80
getCollectionMethod · 0.65
resolveMethod · 0.65
addMethod · 0.65
getQualifiedKeyMethod · 0.45

Tested by

no test coverage detected