Change the random method to Math.random to Random.nextInt()

This commit is contained in:
Thomas Andres Gomez 2024-01-07 19:27:05 +01:00
parent aa82fc2347
commit dc12434689

View file

@ -1128,7 +1128,7 @@ class DiceThrowUseCase @Inject constructor(
private fun random(faces: Int, fail: Boolean, critical: Boolean): Int = when {
fail && !critical -> 1
critical && !fail -> faces
else -> (Math.random() * faces + 1).toInt()
else -> Random.nextInt(from = 1, until = faces + 1)
}
}