diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-07 23:20:52 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-07 23:20:52 +0100 |
commit | 973c70eb98bfb811ebce565b71d388eb948aa327 (patch) | |
tree | 54760e5ad9bca5b5de6a9f5bbf33cdc39a7d5c9a /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 1374af98253decb917f6c1605b9a45ce822adc91 (diff) | |
download | skyhanni-973c70eb98bfb811ebce565b71d388eb948aa327.tar.gz skyhanni-973c70eb98bfb811ebce565b71d388eb948aa327.tar.bz2 skyhanni-973c70eb98bfb811ebce565b71d388eb948aa327.zip |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
3 files changed, 19 insertions, 23 deletions
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<T : TrackerData>( - 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<Data : TrackerData>( update() } } + + class SharedTracker<Data : TrackerData>(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"), + ; + } + } |