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

Method removeCommonFromList

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

Remove the common modifiers from the alternate list. @param altList the list of modifiers on the secondary head @param commonList The list of modifiers common between the two heads @param errMsg the error message to print if something goes wrong

(final List<EquipmentModifier> altList, final List<EquipmentModifier> commonList,
		final String errMsg)

Source from the content-addressed store, hash-verified

4338 * @param errMsg the error message to print if something goes wrong
4339 */
4340 private void removeCommonFromList(final List<EquipmentModifier> altList, final List<EquipmentModifier> commonList,
4341 final String errMsg)
4342 {
4343
4344 for (int i = altList.size() - 1; i >= 0; --i)
4345 {
4346 final EquipmentModifier eqMod = altList.get(i);
4347
4348 if (!eqMod.getSafe(ObjectKey.ASSIGN_TO_ALL))
4349 {
4350 continue;
4351 }
4352
4353 final int j = commonList.indexOf(eqMod);
4354
4355 if (j >= 0)
4356 {
4357 altList.remove(i);
4358 }
4359 else
4360 {
4361 Logging.errorPrint(errMsg + eqMod.getDisplayName());
4362 }
4363 }
4364 }
4365
4366 /**
4367 * Initialise an array of equipment modifier lists with an entry for each

Callers 2

getSpecialPropertiesMethod · 0.95

Calls 7

errorPrintMethod · 0.95
getSafeMethod · 0.80
sizeMethod · 0.65
getMethod · 0.65
indexOfMethod · 0.65
removeMethod · 0.65
getDisplayNameMethod · 0.65

Tested by

no test coverage detected