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

Method replaceCostCharges

code/src/java/pcgen/core/analysis/EqModCost.java:235–252  ·  view source on GitHub ↗
(String costFormula, final String listEntry)

Source from the content-addressed store, hash-verified

233 }
234
235 private static String replaceCostCharges(String costFormula, final String listEntry)
236 {
237 String modChoice = "";
238
239 while (costFormula.contains("%" + S_CHARGES))
240 {
241 final int idx = costFormula.indexOf("%" + S_CHARGES);
242
243 if (modChoice.isEmpty())
244 {
245 modChoice = Integer.toString(EqModSpellInfo.getSpellInfo(listEntry, S_CHARGES));
246 }
247
248 costFormula = costFormula.substring(0, idx) + modChoice + costFormula.substring(idx + 8);
249 }
250
251 return costFormula;
252 }
253
254 private static String replaceCostSpellCost(String costFormula, final String listEntry)
255 {

Callers 1

getCostMethod · 0.95

Calls 5

getSpellInfoMethod · 0.95
containsMethod · 0.65
indexOfMethod · 0.65
isEmptyMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected