Get the value for a load score @param score @return the value for a load score
(int score)
| 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 |
no test coverage detected