From 8e60e5ff9e791cb50bf50f93b3753254b160355d Mon Sep 17 00:00:00 2001 From: fdai7906 Date: Fri, 2 Feb 2024 17:18:08 +0100 Subject: [PATCH] add playCard Draw --- src/main/java/de/hsfulda/onses/services/GameService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/de/hsfulda/onses/services/GameService.java b/src/main/java/de/hsfulda/onses/services/GameService.java index 7788995..bca18b9 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -22,6 +22,9 @@ public class GameService { public void nextPlayer() { game.getPlayerService().nextTurn(); + } + public void drawCard(int amount) { + } public void playCard(Player player, Card card) { @@ -44,6 +47,12 @@ public class GameService { Card.Color color = Card.Color.BLUE; //Vorübergehend Blau game.changeLastPlayedCardColor(color); } + // Draw + if (card.getValue() == Card.Value.DRAWTWO) { + nextPlayer(); + drawCard(2); + nextPlayer(); + } } public boolean legalMove(Player player, Card card)