From ef6a49ca03b1580d900505b14dc74edd7564638c Mon Sep 17 00:00:00 2001 From: Fredrik Ullman <42198444+Fredrik93@users.noreply.github.com> Date: Thu, 27 Mar 2025 12:59:37 +0100 Subject: [PATCH] Update LuckyNumberBadgeProcessor.java Fixes a few typos; Check if currentscore is the lucky number 42 Replace incorrect badge with correct one Signed-off-by: Fredrik Ullman <42198444+Fredrik93@users.noreply.github.com> --- .../game/badgeprocessors/LuckyNumberBadgeProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gamification/src/main/java/microservices/book/gamification/game/badgeprocessors/LuckyNumberBadgeProcessor.java b/gamification/src/main/java/microservices/book/gamification/game/badgeprocessors/LuckyNumberBadgeProcessor.java index 377f4be..25462a8 100644 --- a/gamification/src/main/java/microservices/book/gamification/game/badgeprocessors/LuckyNumberBadgeProcessor.java +++ b/gamification/src/main/java/microservices/book/gamification/game/badgeprocessors/LuckyNumberBadgeProcessor.java @@ -10,13 +10,13 @@ public class LuckyNumberBadgeProcessor implements BadgeProcessor{ @Override public Optional processForOptionalBadge(int currentScore, List scoreCardList, ChallengeSolvedDTO solved) { - return currentScore > 150 ? - Optional.of(BadgeType.SILVER) : + return currentScore == 42 ? + Optional.of(BadgeType.LUCKY_NUMBER) : Optional.empty(); } @Override public BadgeType badgeType() { - return BadgeType.SILVER; + return BadgeType.LUCKY_NUMBER; } }