diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-04 15:04:44 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-04 15:04:44 +0100 |
commit | 04e7a2736b117f43843912cc3bf141afe4bc2616 (patch) | |
tree | 62d1f706c542d0502fed933aec8b472a47b576da | |
parent | fa9608670a677dcdf42f8c30c80100c440c895b9 (diff) | |
download | skyhanni-04e7a2736b117f43843912cc3bf141afe4bc2616.tar.gz skyhanni-04e7a2736b117f43843912cc3bf141afe4bc2616.tar.bz2 skyhanni-04e7a2736b117f43843912cc3bf141afe4bc2616.zip |
code cleanup
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt index e7306756e..98ac19a76 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -117,7 +117,7 @@ class BingoCardDisplay { var hiddenGoals = 0 var nextTip = 7.days for (goal in todo.toList()) { - val hiddenGoalData = goal.hiddenGoalData ?: continue + val hiddenGoalData = goal.hiddenGoalData if (hiddenGoalData.unknownTip) { hiddenGoals++ todo.remove(goal) diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt index 2c7e8cb8b..5c9c7aa5b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt @@ -33,9 +33,11 @@ class BingoCardReader { BingoAPI.bingoGoals.clear() for ((slot, stack) in event.inventoryItems) { - val isPersonalGoal = stack.getLore().any { it.endsWith("Personal Goal") } - val isCommunityGoal = stack.getLore().any { it.endsWith("Community Goal") } - if (!isPersonalGoal && !isCommunityGoal) continue + val goalType = when { + stack.getLore().any { it.endsWith("Personal Goal") } -> GoalType.PERSONAL + stack.getLore().any { it.endsWith("Community Goal") } -> GoalType.COMMUNITY + else -> continue + } val name = stack.name?.removeColor() ?: continue val lore = stack.getLore() var index = 0 @@ -58,7 +60,6 @@ class BingoCardReader { val done = stack.getLore().any { it.contains("GOAL REACHED") } - val goalType = if (isPersonalGoal) GoalType.PERSONAL else GoalType.COMMUNITY val hiddenGoalData = getHiddenGoalData(name, description, goalType) val visualDescription = hiddenGoalData.tipNote |