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

Method getWeightAdjustedForSize

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

Gets the weightAdjustedForSize attribute of the Equipment object @param aPC the PC with the Equipment @param newSA the size to adjust for @return The weightAdjustedForSize value

(final PlayerCharacter aPC, final SizeAdjustment newSA)

Source from the content-addressed store, hash-verified

4086 * @return The weightAdjustedForSize value
4087 */
4088 private BigDecimal getWeightAdjustedForSize(final PlayerCharacter aPC, final SizeAdjustment newSA)
4089 {
4090
4091 if (this.virtualItem)
4092 {
4093 return BigDecimal.ZERO;
4094 }
4095
4096 BigDecimal weight = getBaseWeight();
4097 if ((newSA == null) || (getSizeAdjustment() == null))
4098 {
4099 return weight;
4100 }
4101
4102 if (aPC != null)
4103 {
4104 final double mult = getWeightMultiplier(aPC, newSA);
4105 weight = weight.multiply(new BigDecimal(String.valueOf(mult)));
4106 }
4107
4108 return weight;
4109 }
4110
4111 private double getWeightMultiplier(final PlayerCharacter aPC,
4112 final SizeAdjustment newSA)

Callers 1

resizeItemMethod · 0.95

Calls 5

getBaseWeightMethod · 0.95
getSizeAdjustmentMethod · 0.95
getWeightMultiplierMethod · 0.95
multiplyMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected