aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-07 23:20:52 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-07 23:20:52 +0100
commit973c70eb98bfb811ebce565b71d388eb948aa327 (patch)
tree54760e5ad9bca5b5de6a9f5bbf33cdc39a7d5c9a /src/main
parent1374af98253decb917f6c1605b9a45ce822adc91 (diff)
downloadskyhanni-973c70eb98bfb811ebce565b71d388eb948aa327.tar.gz
skyhanni-973c70eb98bfb811ebce565b71d388eb948aa327.tar.bz2
skyhanni-973c70eb98bfb811ebce565b71d388eb948aa327.zip
code cleanup
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/DisplayMode.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SharedTracker.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt19
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"),
+ ;
+ }
+
}