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

Method cloneEqModList

code/src/java/pcgen/core/Equipment.java:4167–4187  ·  view source on GitHub ↗
(Equipment other, boolean primary)

Source from the content-addressed store, hash-verified

4165 }
4166
4167 private List<EquipmentModifier> cloneEqModList(Equipment other, boolean primary)
4168 {
4169
4170 final List<EquipmentModifier> clonedList = new ArrayList<>();
4171
4172 for (EquipmentModifier eqMod : getEqModifierList(primary))
4173 {
4174
4175 // only make a copy if we need to add qualifiers to modifier
4176 if (!eqMod.getSafe(StringKey.CHOICE_STRING).isEmpty())
4177 {
4178 EquipmentModifier newEqMod = eqMod.clone();
4179 other.assocSupt.convertAssociations(eqMod, newEqMod);
4180 eqMod = newEqMod;
4181 }
4182
4183 clonedList.add(eqMod);
4184 }
4185
4186 return clonedList;
4187 }
4188
4189 /**
4190 * Checks whether the child type is possessed

Callers 1

cloneMethod · 0.95

Calls 6

getEqModifierListMethod · 0.95
getSafeMethod · 0.80
convertAssociationsMethod · 0.80
isEmptyMethod · 0.65
addMethod · 0.65
cloneMethod · 0.45

Tested by

no test coverage detected