From 3bffc7657ad474b32f8374fa056286243379fa6b Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Thu, 30 Nov 2023 17:13:52 -0300 Subject: [PATCH] Fix lint --- .../antimine/common/level/viewmodel/GameViewModel.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt index ba39c74f..ef8e4727 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt @@ -34,7 +34,6 @@ import dev.lucasnlm.external.Leaderboard import dev.lucasnlm.external.PlayGamesManager import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flowOf @@ -780,11 +779,9 @@ open class GameViewModel( } } - private fun matchExpectedValueStoch(x: Double): Int { - + private fun matchExpectedValueStoch(value: Double): Int { val randomNum = (1..100).random() - - return if (randomNum <= (x - x.toInt())*100) x.toInt() + 1 else x.toInt() + return if (randomNum <= (value - value.toInt()) * 100) value.toInt() + 1 else value.toInt() } private fun calcRewardHints(): Int {