From 23daf286686a5124e3c7ba27820cb7125355da84 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 3 Apr 2024 19:30:42 +0200 Subject: code cleanup --- .../event/diana/MythologicalCreatureTracker.kt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/main/java') 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 = 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 -- cgit