From c6e75dfd85b2a8b7782f82c4542ff76e0ba21175 Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Sat, 3 Feb 2024 17:06:47 +0100 Subject: [PATCH] refactoring: addChangeColor --- .../de/hsfulda/onses/services/GameService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/services/GameService.java b/src/main/java/de/hsfulda/onses/services/GameService.java index ec2d647..5600b04 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -53,6 +53,12 @@ public class GameService { game.addCardToDrawCardDeck(lastCard); } + public void changeColor() { + // Abfrage Farbe + Card.Color color = Card.Color.BLUE; //Vorübergehend Blau + game.changeLastPlayedCardColor(color); + } + public void playCard(Card card) { // add lastPlayedCard back to drawCardDeck this.addLastPlayedCardToDrawCardDeck(); @@ -70,15 +76,11 @@ public class GameService { nextPlayer(); break; case CHOOSE: - // Abfrage Farbe - Card.Color color = Card.Color.BLUE; //Vorübergehend Blau - game.changeLastPlayedCardColor(color); + changeColor(); nextPlayer(); break; case CHOOSEDRAW: - // Abfrage Farbe - Card.Color color1 = Card.Color.BLUE; //Vorübergehend Blau - game.changeLastPlayedCardColor(color1); + changeColor(); nextPlayer(); drawCard(4); break;