Removes a child from the Equipment @param pc The PC carrying the item @param child The child to remove
(final PlayerCharacter pc, final Object child)
| 3188 | * The child to remove |
| 3189 | */ |
| 3190 | public void removeChild(final PlayerCharacter pc, final Object child) |
| 3191 | { |
| 3192 | |
| 3193 | final int i = indexOfChild(child); |
| 3194 | Equipment anEquip = (Equipment) child; |
| 3195 | final Float qtyRemoved = anEquip.numberCarried(); |
| 3196 | setChildType("Total", getChildType("Total") - qtyRemoved); |
| 3197 | |
| 3198 | final String aString = anEquip.isIndexedUnderType(); |
| 3199 | setChildType(aString, getChildType(aString) - qtyRemoved); |
| 3200 | anEquip.setParent(null); |
| 3201 | removeContainedEquipment(i); |
| 3202 | updateContainerContentsString(pc); |
| 3203 | |
| 3204 | Equipment equipment = this; |
| 3205 | |
| 3206 | while (equipment.getParent() != null) |
| 3207 | { |
| 3208 | equipment = equipment.getParent(); |
| 3209 | equipment.updateContainerContentsString(pc); |
| 3210 | } |
| 3211 | } |
| 3212 | |
| 3213 | /** |
| 3214 | * Description of the Method |
no test coverage detected