use of pcgen.core.ClassType in project pcgen by PCGen.
the class ChallengeRatingFacet method getClassCRModPriority.
private int getClassCRModPriority(PCClass cl) {
int crModPriority = 0;
ClassType aClassType = SettingsHandler.getGame().getClassTypeByName(cl.getClassType());
if (aClassType != null) {
int crmp = aClassType.getCRModPriority();
if (crmp != 0) {
crModPriority = crmp;
}
} else {
// use old method to determine the class type from TYPE.
for (Type type : cl.getTrueTypeList(false)) {
aClassType = SettingsHandler.getGame().getClassTypeByName(type.toString());
if (aClassType != null) {
int crmp = aClassType.getCRModPriority();
if (crmp != 0) {
crModPriority = aClassType.getCRModPriority();
}
}
}
}
return crModPriority;
}
use of pcgen.core.ClassType in project pcgen by PCGen.
the class ChallengeRatingFacet method getClassCRMod.
private int getClassCRMod(CharID id, PCClass cl) {
int crMod = 0;
ClassType aClassType = SettingsHandler.getGame().getClassTypeByName(cl.getClassType());
if (aClassType != null) {
String crmf = aClassType.getCRMod();
Formula crm = FormulaFactory.getFormulaFor(crmf);
crMod = Math.min(crMod, formulaResolvingFacet.resolve(id, crm, cl.getQualifiedKey()).intValue());
} else {
// use old method to determine the class type from TYPE.
for (Type type : cl.getTrueTypeList(false)) {
aClassType = SettingsHandler.getGame().getClassTypeByName(type.toString());
if (aClassType != null) {
String crmf = aClassType.getCRMod();
Formula crm = FormulaFactory.getFormulaFor(crmf);
crMod = Math.min(crMod, formulaResolvingFacet.resolve(id, crm, cl.getQualifiedKey()).intValue());
}
}
}
return crMod;
}