From a8c26a1d6103264765bacd7ee19ec795ffae637b Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Fri, 2 Feb 2024 16:33:02 +0100 Subject: [PATCH] refactoring: nextPlayer --- src/main/java/de/hsfulda/onses/services/GameService.java | 7 +++++-- 1 file changed, 5 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 d786a23..a3d14b2 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -20,6 +20,9 @@ public class GameService { return game; } + public void nextPlayer() { + game.getPlayerService().nextTurn(); + } public void playCard(Player player, Card card) { // add lastPlayedCard back to drawCardDeck @@ -27,8 +30,8 @@ public class GameService { // check for special rules (draw, colorchoose, skip,...) // Skip if (card.getValue() == Card.Value.SKIP) { - game.getPlayerService().nextTurn(); - game.getPlayerService().nextTurn(); + nextPlayer(); + nextPlayer(); } }