mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Iris range class (json tools)
This commit is contained in:
parent
8815518af9
commit
185cc994f7
35
src/main/java/com/volmit/iris/object/IrisRange.java
Normal file
35
src/main/java/com/volmit/iris/object/IrisRange.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.volmit.iris.object;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.Desc;
|
||||||
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
|
import com.volmit.iris.util.RNG;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Desc("Represents a range")
|
||||||
|
@Data
|
||||||
|
public class IrisRange
|
||||||
|
{
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The minimum value")
|
||||||
|
private double min = 16;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The maximum value")
|
||||||
|
private double max = 32;
|
||||||
|
|
||||||
|
public double get(RNG rng)
|
||||||
|
{
|
||||||
|
if(min == max)
|
||||||
|
{
|
||||||
|
return min;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rng.d(min, max);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user