diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-13 22:53:41 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-13 22:53:41 +0200 |
commit | 7fe3e879e82b2c83df90e9de4856ca5da510c5f5 (patch) | |
tree | 38ef8f091ff266e05568284615e87a68fd85b9f0 /src | |
parent | a2d17be9e0fa7155aab1990cb5969ced6305ba1b (diff) | |
download | skyhanni-7fe3e879e82b2c83df90e9de4856ca5da510c5f5.tar.gz skyhanni-7fe3e879e82b2c83df90e9de4856ca5da510c5f5.tar.bz2 skyhanni-7fe3e879e82b2c83df90e9de4856ca5da510c5f5.zip |
code cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt index b6d1ba219..d79ac47ce 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt @@ -101,9 +101,9 @@ object DungeonAPI { } } - fun inDungeon() = IslandType.CATACOMBS.isInIsland() + fun inDungeon(): Boolean = IslandType.CATACOMBS.isInIsland() - fun isOneOf(vararg floors: String) = dungeonFloor?.equalsOneOf(*floors) == true + fun isOneOf(vararg floors: String): Boolean = dungeonFloor?.equalsOneOf(*floors) == true fun handleBossMessage(rawMessage: String) { if (!inDungeon()) return @@ -132,22 +132,20 @@ object DungeonAPI { return bossName.endsWith(correctBoss) } - fun getTime(): String = - ScoreboardData.sidebarLinesFormatted.matchFirst(timePattern) { - "${groupOrNull("minutes") ?: "00"}:${group("seconds")}" - } ?: "" + fun getTime(): String = ScoreboardData.sidebarLinesFormatted.matchFirst(timePattern) { + "${groupOrNull("minutes") ?: "00"}:${group("seconds")}" + } ?: "" fun getCurrentBoss(): DungeonFloor? { val floor = dungeonFloor ?: return null return DungeonFloor.valueOf(floor.replace("M", "F")) } - fun getRoomID(): String? { - return ScoreboardData.sidebarLinesFormatted.matchFirst(dungeonRoomPattern) { - group("roomId") - } + fun getRoomID(): String? = ScoreboardData.sidebarLinesFormatted.matchFirst(dungeonRoomPattern) { + group("roomId") } + fun getColor(level: Int): String = when { level >= 50 -> "§c§l" level >= 45 -> "§c" |