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

Method getLoadScoreValue

code/src/java/pcgen/core/system/LoadInfo.java:106–135  ·  view source on GitHub ↗

Get the value for a load score @param score @return the value for a load score

(int score)

Source from the content-addressed store, hash-verified

104 * @return the value for a load score
105 */
106 public BigDecimal getLoadScoreValue(int score)
107 {
108 if (score < minStrenghScoreWithLoad)
109 {
110 return BigDecimal.ZERO;
111 }
112 else if (score > maxStrengthScoreWithLoad)
113 {
114 if (getLoadMultiplierCount() == 1)
115 {
116 // TODO Isn't this a bug??
117 return getLoadScoreValue(minStrenghScoreWithLoad);
118 }
119 return loadScoreMultiplier.multiply(getLoadScoreValue(score - loadMultStep));
120 }
121 else
122 {
123 BigDecimal loadScore = strengthLoadMap.get(score);
124 if (loadScore == null)
125 {
126 SortedMap<Integer, BigDecimal> headMap = strengthLoadMap.headMap(score);
127 /*
128 * Assume headMap is populated, since minScore is tested, above -
129 * thpr Mar 14, 2007
130 */
131 return strengthLoadMap.get(headMap.lastKey());
132 }
133 return loadScore;
134 }
135 }
136
137 /**
138 * Add a size adjustment

Callers 1

getMaxLoadMethod · 0.80

Calls 3

getMethod · 0.65
multiplyMethod · 0.45

Tested by

no test coverage detected