aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt
index 984c60df7..0e2ed1fef 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt
@@ -33,7 +33,7 @@ class GardenCropMilestones {
fun onProfileJoin(event: ProfileJoinEvent) {
if (cropCounter.isEmpty()) {
for (crop in CropType.values()) {
- cropCounter[crop] = 0
+ crop.setCounter(0)
}
}
}
@@ -65,7 +65,7 @@ class GardenCropMilestones {
if (matcher.matches()) {
val rawNumber = matcher.group(1)
val overflow = rawNumber.formatNumber()
- cropCounter[crop] = cropForTier + overflow
+ crop.setCounter(cropForTier + overflow)
}
next = false
}
@@ -80,6 +80,8 @@ class GardenCropMilestones {
fun CropType.getCounter() = cropCounter[this]!!
+ fun CropType.setCounter(counter: Long) { cropCounter[this] = counter }
+
fun getTierForCrops(crops: Long): Int {
var tier = 0
var totalCrops = 0L