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

Method checkChildWeight

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

Test whether the container would be within its weight limits if we added an item of weight aFloat @param aPC The PC with the Equipment @param aFloat The weight of the item we want to add to the container @return True if the container is capable of holding the item

(final PlayerCharacter aPC, final Float aFloat)

Source from the content-addressed store, hash-verified

4142 * True if the container is capable of holding the item
4143 */
4144 private boolean checkChildWeight(final PlayerCharacter aPC, final Float aFloat)
4145 {
4146
4147 BigDecimal weightCap = get(ObjectKey.CONTAINER_WEIGHT_CAPACITY);
4148 return weightCap != null
4149 && (Capacity.UNLIMITED.equals(weightCap) || (aFloat + getContainedWeight(aPC)) <= weightCap.doubleValue());
4150 }
4151
4152 /**
4153 * Does this item fit in this container

Callers 1

canContainMethod · 0.95

Calls 4

getContainedWeightMethod · 0.95
doubleValueMethod · 0.80
getMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected