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

Method getTotalCostToBeCharged

code/src/java/pcgen/core/Kit.java:212–224  ·  view source on GitHub ↗

Gets the specified total cost of the kit modified by the user's chosen gear purchase rate on the gear tab. @param aPC The character used to evaluate expressions in relation to @return Cost to be charged, or null if no total cost was specified.

(PlayerCharacter aPC)

Source from the content-addressed store, hash-verified

210 * @return Cost to be charged, or null if no total cost was specified.
211 */
212 public BigDecimal getTotalCostToBeCharged(PlayerCharacter aPC)
213 {
214 BigDecimal theCost = null;
215 BigDecimal fixedTotalCost = getTotalCost(aPC);
216 if (fixedTotalCost != null)
217 {
218 fixedTotalCost = fixedTotalCost.setScale(3);
219 BigDecimal buyRate = new BigDecimal(SettingsHandler.getGearTab_BuyRate());
220 theCost = fixedTotalCost.multiply(buyRate).divide(new BigDecimal(100).setScale(3), RoundingMode.FLOOR);
221 }
222
223 return theCost;
224 }
225
226 /**
227 * Returns true if the kit is visible

Callers 3

processKitMethod · 0.95
testApplyKitMethod · 0.95
isQualifiedForMethod · 0.80

Calls 4

getTotalCostMethod · 0.95
getGearTab_BuyRateMethod · 0.95
divideMethod · 0.80
multiplyMethod · 0.45

Tested by

no test coverage detected