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

Method getBaseContainedWeight

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

Get Base contained weight @return Base contained weight

()

Source from the content-addressed store, hash-verified

5357 * @return Base contained weight
5358 */
5359 public Float getBaseContainedWeight()
5360 {
5361
5362 float total = 0.0f;
5363
5364 if ((getSafe(ObjectKey.CONTAINER_CONSTANT_WEIGHT)) || (getChildCount() == 0))
5365 {
5366 return total;
5367 }
5368
5369 for (int e = 0; e < getContainedEquipmentCount(); ++e)
5370 {
5371 final Equipment anEquip = getContainedEquipment(e);
5372
5373 if (anEquip.getContainedEquipmentCount() > 0)
5374 {
5375 total = total + anEquip.getBaseWeight().floatValue() + anEquip.getBaseContainedWeight();
5376 }
5377 else
5378 {
5379 total += anEquip.getBaseWeight().floatValue() * anEquip.getCarried();
5380 }
5381 }
5382
5383 Integer crw = get(IntegerKey.CONTAINER_REDUCE_WEIGHT);
5384 if (crw != null && crw != 0)
5385 {
5386 total *= (crw.floatValue() / 100);
5387 }
5388
5389 return total;
5390 }
5391
5392 /**
5393 * Gets the contained Weight this object recursis all child objects to get

Callers

nothing calls this directly

Calls 8

getChildCountMethod · 0.95
getContainedEquipmentMethod · 0.95
getBaseWeightMethod · 0.95
getCarriedMethod · 0.95
getSafeMethod · 0.80
floatValueMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected