From 620b82e202139f12fcf9112b6250013f1bc92785 Mon Sep 17 00:00:00 2001 From: fdai7920 Date: Sat, 3 Feb 2024 00:41:33 +0100 Subject: [PATCH] refactoring: move one nextTurn into drawCard --- src/main/java/de/hsfulda/onses/services/GameService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/services/GameService.java b/src/main/java/de/hsfulda/onses/services/GameService.java index fe77037..92dd8cb 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -36,6 +36,9 @@ public class GameService { player.getPlayerDeck().add(game.getDrawCardDeck().getFirst()); game.getDrawCardDeck().removeFirst(); } + if (amount != 1) { + nextPlayer(); + } } public void playCard(Player player, Card card) { @@ -63,7 +66,6 @@ public class GameService { if (card.getValue() == Card.Value.DRAWTWO) { nextPlayer(); drawCard(2); - nextPlayer(); } // ChooseDraw if (card.getValue() == Card.Value.CHOOSEDRAW) { @@ -72,7 +74,6 @@ public class GameService { game.changeLastPlayedCardColor(color); nextPlayer(); drawCard(4); - nextPlayer(); } }