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

Method processKit

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

The method that actually adds the various items in this Kit to the PC. Takes account of Kit Number @param pc The Player Character object that we will be applying the kit to. @param thingsToAdd The list of things that will be added by this kit w

(final PlayerCharacter pc, final Collection<BaseKit> thingsToAdd)

Source from the content-addressed store, hash-verified

129 * wrapped in KitWrapper objects
130 */
131 public void processKit(final PlayerCharacter pc, final Collection<BaseKit> thingsToAdd)
132 {
133 BigDecimal totalCostToBeCharged = getTotalCostToBeCharged(pc);
134 if (totalCostToBeCharged != null)
135 {
136 Number currentGold = (Number) ChannelUtilities
137 .readControlledChannel(pc.getCharID(), CControl.GOLDINPUT);
138 ChannelUtilities.setControlledChannel(pc.getCharID(),
139 CControl.GOLDINPUT, new BigDecimal(currentGold.toString()).subtract(totalCostToBeCharged));
140 }
141
142 for (KitStat kStat : getStats())
143 {
144 kStat.apply(pc);
145 }
146
147 for (BaseKit bk : thingsToAdd)
148 {
149 bk.apply(pc);
150 }
151 pc.setCalcEquipmentList();
152
153 if (getSafe(ObjectKey.APPLY_MODE) == KitApply.PERMANENT)
154 {
155 pc.addKit(this);
156 }
157 }
158
159 /**
160 * Gets the buy rate of the kit.

Callers 3

addKitMethod · 0.80
applyKitMethod · 0.80
applyMethod · 0.80

Calls 11

readControlledChannelMethod · 0.95
setControlledChannelMethod · 0.95
getStatsMethod · 0.95
subtractMethod · 0.80
setCalcEquipmentListMethod · 0.80
getSafeMethod · 0.80
getCharIDMethod · 0.65
toStringMethod · 0.65
applyMethod · 0.65
addKitMethod · 0.65

Tested by

no test coverage detected