use of pcgen.cdom.converter.AddFilterConverter in project pcgen by PCGen.
the class SpellLevelInfo method getLevels.
public Collection<SpellLevel> getLevels(PlayerCharacter pc) {
List<SpellLevel> list = new ArrayList<>();
Converter<PCClass, PCClass> conv = new AddFilterConverter<>(new DereferencingConverter<>(pc), this);
for (PCClass cl : filter.getCollection(pc, conv)) {
int min = minimumLevel.resolve(pc, cl.getQualifiedKey()).intValue();
int max = maximumLevel.resolve(pc, cl.getQualifiedKey()).intValue();
if (min > max) {
Logging.errorPrint("Resolved Minimum: " + min + " (from " + minimumLevel + ") was greater than resolved Maximum: " + max + " (from " + maximumLevel + ")");
}
for (int i = min; i <= max; ++i) {
list.add(new SpellLevel(cl, i));
}
}
return list;
}
Aggregations