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)
| 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 |
no test coverage detected