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

Method findDefaultSpellClass

code/src/java/pcgen/core/kit/KitSpells.java:228–243  ·  view source on GitHub ↗
(final CDOMSingleRef<PCClass> ref, PlayerCharacter aPC)

Source from the content-addressed store, hash-verified

226 }
227
228 private PCClass findDefaultSpellClass(final CDOMSingleRef<PCClass> ref, PlayerCharacter aPC)
229 {
230 if (castingClass == null)
231 {
232 List<? extends PObject> spellcastingClasses = aPC.getSpellClassList();
233 for (PObject obj : spellcastingClasses)
234 {
235 if (obj instanceof PCClass)
236 {
237 return (PCClass) obj;
238 }
239 }
240 return null;
241 }
242 return aPC.getClassKeyed(ref.get().getKeyName());
243 }
244
245 /**
246 * Add spells from this Kit to the PC

Callers 1

testApplyMethod · 0.95

Calls 4

getSpellClassListMethod · 0.80
getKeyNameMethod · 0.65
getMethod · 0.65
getClassKeyedMethod · 0.45

Tested by

no test coverage detected