|
|
@@ -13,10 +13,11 @@ import lombok.NonNull;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.experimental.FieldDefaults;
|
|
|
|
|
|
-import static org.leumasjaffe.charsheet.config.Constants.*;
|
|
|
+import static org.leumasjaffe.charsheet.config.Constants.K_DISTANCE;
|
|
|
+import static org.leumasjaffe.charsheet.config.Constants.DistanceMeasurement.*;
|
|
|
|
|
|
public interface Range {
|
|
|
- @FieldDefaults(level=AccessLevel.PUBLIC, makeFinal=true)
|
|
|
+ @FieldDefaults(level=AccessLevel.PRIVATE, makeFinal=true)
|
|
|
public static final class __Pair {
|
|
|
int[] value;
|
|
|
String measure;
|
|
|
@@ -24,7 +25,7 @@ public interface Range {
|
|
|
private __Pair(int... feet) {
|
|
|
value = new int[feet.length];
|
|
|
final int div;
|
|
|
- if (Config.<Integer>get(DISTANCE, DISTANCE_MEASUREMENT_FEET).equals(DISTANCE_MEASUREMENT_SQUARES)) {
|
|
|
+ if (Config.get(K_DISTANCE, FEET) == SQUARES) {
|
|
|
div = 5;
|
|
|
measure = "squares";
|
|
|
} else {
|
|
|
@@ -108,8 +109,8 @@ public interface Range {
|
|
|
|
|
|
public String toString() {
|
|
|
final __Pair p = new __Pair(range, per);
|
|
|
- final StringBuilder str = new StringBuilder(StringHelper.format("{} ({} {3} + {} {}/{?level:{} levels})",
|
|
|
- name, p.value[0], p.value[1], p.measure, step == 1, step));
|
|
|
+ final StringBuilder str = new StringBuilder(StringHelper.format("{} ({} {3} + {} {}/{=1?level:{4} levels})",
|
|
|
+ name, p.value[0], p.value[1], p.measure, step));
|
|
|
return str.toString();
|
|
|
}
|
|
|
}
|