diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt index d07172609..da7f0b05b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt @@ -93,6 +93,14 @@ class GardenCropMilestones { return 0 } + fun CropType.progressToNextLevel(): Double { + val progress = getCounter() + val startTier = getTierForCrops(progress) + val startCrops = getCropsForTier(startTier) + val end = getCropsForTier(startTier + 1).toDouble() + return (progress - startCrops) / (end - startCrops) + } + // TODO use repo private val cropMilestone = listOf( 100, |