Upload files to "src/openonyx/history"
This commit is contained in:
1 parent
51cb99e2b8
commit
57f447491e
5 files changed
+445
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package openonyx.history;
|
||||
|
||||
import openonyx.history.internal.RangeSetting;
|
||||
|
||||
public class RangeRoll {
|
||||
private double f;
|
||||
private final boolean H;
|
||||
private final RangeSetting rangeSetting;
|
||||
|
||||
public void L() {
|
||||
this.f = this.H ? this.rangeSetting.randomInt() : this.rangeSetting.random();
|
||||
}
|
||||
|
||||
public RangeRoll(RangeSetting rangeSetting) {
|
||||
this.rangeSetting = rangeSettingx;
|
||||
this.H = rangeSettingx.isInteger();
|
||||
rangeSettingx.onChange(range -> this.L());
|
||||
this.L();
|
||||
}
|
||||
|
||||
public int L() {
|
||||
return (int)Math.round(this.f);
|
||||
}
|
||||
|
||||
public float L() {
|
||||
return (float)this.f;
|
||||
}
|
||||
|
||||
public double L() {
|
||||
return this.f;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user