From 973c70eb98bfb811ebce565b71d388eb948aa327 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:20:52 +0100 Subject: code cleanup --- .../hannibal2/skyhanni/utils/tracker/DisplayMode.kt | 7 ------- .../hannibal2/skyhanni/utils/tracker/SharedTracker.kt | 16 ---------------- .../skyhanni/utils/tracker/SkyHanniTracker.kt | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+), 23 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt deleted file mode 100644 index 55441953c..000000000 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt +++ /dev/null @@ -1,7 +0,0 @@ -package at.hannibal2.skyhanni.utils.tracker - -enum class DisplayMode(val displayName: String) { - TOTAL("Total"), - SESSION("This Session"), - ; -} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt deleted file mode 100644 index 9b5ae1d90..000000000 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt +++ /dev/null @@ -1,16 +0,0 @@ -package at.hannibal2.skyhanni.utils.tracker - -class SharedTracker( - private val total: T, - private val currentSession: T, -) { - fun modify(modifyFunction: (T) -> Unit) { - modifyFunction(total) - modifyFunction(currentSession) - } - - fun get(displayMode: DisplayMode) = when (displayMode) { - DisplayMode.TOTAL -> total - DisplayMode.SESSION -> currentSession - } -} diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt index 8d5b723df..4cf1f8e5f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt @@ -96,4 +96,23 @@ class SkyHanniTracker( update() } } + + class SharedTracker(private val total: Data, private val currentSession: Data, ) { + fun modify(modifyFunction: (Data) -> Unit) { + modifyFunction(total) + modifyFunction(currentSession) + } + + fun get(displayMode: DisplayMode) = when (displayMode) { + DisplayMode.TOTAL -> total + DisplayMode.SESSION -> currentSession + } + } + + enum class DisplayMode(val displayName: String) { + TOTAL("Total"), + SESSION("This Session"), + ; + } + } -- cgit