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

Method apply

code/src/java/pcgen/cdom/facet/AddLevelFacet.java:170–181  ·  view source on GitHub ↗

Applies a change in the given number of levels of the given PCClass to the given PlayerCharacter. If the number of levels is greater than zero, then levels are added to the given PlayerCharacter, if less than zero, levels are removed from the given PlayerCharacter. @param pc The PlayerCh

(PlayerCharacter pc, PCClass pcClass, int levels)

Source from the content-addressed store, hash-verified

168 * if the given PlayerCharacter is null
169 */
170 private void apply(PlayerCharacter pc, PCClass pcClass, int levels)
171 {
172 boolean tempShowHP = SettingsHandler.getShowHPDialogAtLevelUp();
173 SettingsHandler.setShowHPDialogAtLevelUp(false);
174 int tempChoicePref = UIPropertyContext.getSingleChoiceAction();
175 UIPropertyContext.setSingleChoiceAction(Constants.CHOOSER_SINGLE_CHOICE_METHOD_SELECT_EXIT);
176
177 pc.incrementClassLevel(levels, pcClass, true, true);
178
179 UIPropertyContext.setSingleChoiceAction(tempChoicePref);
180 SettingsHandler.setShowHPDialogAtLevelUp(tempShowHP);
181 }
182
183 public void setTemplateFacet(TemplateFacet templateFacet)
184 {

Callers 2

addMethod · 0.95
removeMethod · 0.95

Calls 5

getSingleChoiceActionMethod · 0.95
setSingleChoiceActionMethod · 0.95
incrementClassLevelMethod · 0.80

Tested by

no test coverage detected