aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-03 19:30:42 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-03 19:30:42 +0200
commit23daf286686a5124e3c7ba27820cb7125355da84 (patch)
tree32c5dc37c50780994a2c1ff8bc27db1e0b3d0187 /src/main
parent34c3331d3bc6df500c69c6bb43259db69877cf4d (diff)
downloadskyhanni-23daf286686a5124e3c7ba27820cb7125355da84.tar.gz
skyhanni-23daf286686a5124e3c7ba27820cb7125355da84.tar.bz2
skyhanni-23daf286686a5124e3c7ba27820cb7125355da84.zip
code cleanup
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt
index 79c447662..5ee7f0f20 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt
@@ -57,11 +57,11 @@ object MythologicalCreatureTracker {
override fun reset() {
count.clear()
- mobsSinceLastInquisitor = 0
+ creaturesSinceLastInquisitor = 0
}
@Expose
- var mobsSinceLastInquisitor: Int = 0
+ var creaturesSinceLastInquisitor: Int = 0
@Expose
var count: MutableMap<MythologicalCreatureType, Int> = mutableMapOf()
@@ -81,13 +81,12 @@ object MythologicalCreatureTracker {
MythologicalCreatureType.entries.forEach { creatureType ->
if (creatureType.pattern.matches(event.message)) {
BurrowAPI.lastBurrowRelatedChatMessage = SimpleTimeMark.now()
- tracker.modify { it.count.addOrPut(creatureType, 1) }
- when (creatureType) {
- MythologicalCreatureType.MINOS_INQUISITOR -> {
- tracker.modify { it.mobsSinceLastInquisitor = 0 }
- }
- else -> {
- tracker.modify { it.mobsSinceLastInquisitor += 1 }
+ tracker.modify {
+ it.count.addOrPut(creatureType, 1)
+ // TODO migrate to abstract feature in the future
+ it.creaturesSinceLastInquisitor = when (creatureType) {
+ MythologicalCreatureType.MINOS_INQUISITOR -> 0
+ else -> it.creaturesSinceLastInquisitor + 1
}
}
if (config.hideChat) {
@@ -110,7 +109,7 @@ object MythologicalCreatureTracker {
addAsSingletonList(" §7- §e${amount.addSeparators()} ${creatureType.displayName}$percentageSuffix")
}
addAsSingletonList(" §7- §e${total.addSeparators()} §7Total Mythological Creatures")
- addAsSingletonList(" §7- §e${data.mobsSinceLastInquisitor.addSeparators()} §7Mobs since last Minos Inquisitor")
+ addAsSingletonList(" §7- §e${data.creaturesSinceLastInquisitor.addSeparators()} §7Creatures since last Minos Inquisitor")
}
@SubscribeEvent