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

Method removeEqModifier

code/src/java/pcgen/core/Equipment.java:3223–3252  ·  view source on GitHub ↗

Description of the Method @param eqMod Description of the Parameter @param bPrimary Description of the Parameter @param pc The PC carrying the item

(final EquipmentModifier eqMod, final boolean bPrimary, PlayerCharacter pc)

Source from the content-addressed store, hash-verified

3221 * The PC carrying the item
3222 */
3223 public void removeEqModifier(final EquipmentModifier eqMod, final boolean bPrimary, PlayerCharacter pc)
3224 {
3225
3226 final EquipmentModifier aMod = getEqModifierKeyed(eqMod.getKeyName(), bPrimary);
3227
3228 if (aMod == null)
3229 {
3230 return;
3231 }
3232
3233 // Get a response from user (if one required)
3234 // Remove the modifier if all associated choices are deleted
3235 if (!hasAssociations(aMod) || !EquipmentChoiceDriver.getChoice(0, this, aMod, false, pc))
3236 {
3237 EquipmentHead head = getEquipmentHead(bPrimary ? 1 : 2);
3238 head.removeFromListFor(ListKey.EQMOD, aMod);
3239 if (bPrimary)
3240 {
3241 usePrimaryCache = false;
3242 }
3243 else
3244 {
3245 useSecondaryCache = false;
3246 }
3247
3248 restoreEqModsAfterRemove(pc, eqMod, bPrimary, head);
3249
3250 setDirty(true);
3251 }
3252 }
3253
3254 /**
3255 * Add back in modifiers that this one previously removed.

Callers 2

removeEqModifiersMethod · 0.95

Calls 15

getEqModifierKeyedMethod · 0.95
hasAssociationsMethod · 0.95
getChoiceMethod · 0.95
getEquipmentHeadMethod · 0.95
setDirtyMethod · 0.95
getAssociationListMethod · 0.95
removeAssociationMethod · 0.95
nextTokenMethod · 0.80
hasMoreTokensMethod · 0.80
forEachMethod · 0.80
streamMethod · 0.80

Tested by

no test coverage detected