Mark BooleanProvider impls as data classes so they can be compared
This commit is contained in:
parent
07e6369454
commit
9cfbab6c3c
@ -25,7 +25,7 @@ interface BooleanProvider {
|
|||||||
/**
|
/**
|
||||||
* Each time boolean is sampled, there is a fixed chance for it to test true
|
* Each time boolean is sampled, there is a fixed chance for it to test true
|
||||||
*/
|
*/
|
||||||
class Unbiased(val chance: Float) : BooleanProvider, Instance {
|
data class Unbiased(val chance: Float) : BooleanProvider, Instance {
|
||||||
constructor(chance: Int) : this(1f / chance)
|
constructor(chance: Int) : this(1f / chance)
|
||||||
|
|
||||||
override fun instance(): Instance {
|
override fun instance(): Instance {
|
||||||
@ -57,7 +57,7 @@ interface BooleanProvider {
|
|||||||
*
|
*
|
||||||
* Once roll is successful, `failures` is reset back to 1.
|
* Once roll is successful, `failures` is reset back to 1.
|
||||||
*/
|
*/
|
||||||
class BiasedLinear(val baseChance: Float) : BooleanProvider {
|
data class BiasedLinear(val baseChance: Float) : BooleanProvider {
|
||||||
constructor(middle: Float, at: Int) : this(middle / at)
|
constructor(middle: Float, at: Int) : this(middle / at)
|
||||||
|
|
||||||
private class I(private val baseChance: Float) : Instance {
|
private class I(private val baseChance: Float) : Instance {
|
||||||
|
Loading…
Reference in New Issue
Block a user