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

Method getWeightAsDouble

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

Get the weight as a double @param aPC The PC that has this Equipment @return weight as double

(final PlayerCharacter aPC)

Source from the content-addressed store, hash-verified

2118 * @return weight as double
2119 */
2120 public double getWeightAsDouble(final PlayerCharacter aPC)
2121 {
2122 if (isVirtual())
2123 {
2124 return 0.0;
2125 }
2126
2127 double d1 = bonusTo(aPC, "EQM", "WEIGHTMULT", true);
2128
2129 double aWeight = getWeightInPounds().doubleValue();
2130
2131 if (!CoreUtility.doublesEqual(d1, 0.0))
2132 {
2133 aWeight *= d1;
2134 }
2135
2136 double d2 = bonusTo(aPC, "EQM", "WEIGHTDIV", true);
2137
2138 if (!CoreUtility.doublesEqual(d2, 0))
2139 {
2140 aWeight /= d2;
2141 }
2142
2143 aWeight += bonusTo(aPC, "EQM", "WEIGHTADD", true);
2144 aWeight += getSafe(ObjectKey.WEIGHT_MOD).doubleValue();
2145
2146 return aWeight;
2147 }
2148
2149 /**
2150 * Get wield

Callers 7

getWeightMethod · 0.95
getContainedWeightMethod · 0.95
setWeightMethod · 0.80
getTotalWeightMethod · 0.80
canContainMethod · 0.80
getTotalWtTokenDoubleMethod · 0.80
getWtTokenDoubleMethod · 0.80

Calls 6

isVirtualMethod · 0.95
bonusToMethod · 0.95
getWeightInPoundsMethod · 0.95
doublesEqualMethod · 0.95
doubleValueMethod · 0.80
getSafeMethod · 0.80

Tested by

no test coverage detected