From 3d03ea8a8c17aee30c7c63f9a77da3363ecc5fe0 Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Sun, 4 Feb 2024 20:06:52 +0100 Subject: [PATCH] refactoring: fillPlayerDecks --- .../hsfulda/onses/services/GameService.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/services/GameService.java b/src/main/java/de/hsfulda/onses/services/GameService.java index c07fe43..cc6e016 100644 --- a/src/main/java/de/hsfulda/onses/services/GameService.java +++ b/src/main/java/de/hsfulda/onses/services/GameService.java @@ -15,14 +15,7 @@ public class GameService { fillDrawDeck(); shuffleDeck(); setFirstCard(); - - for (int i = 0; i < 7; i++) { - this.drawCard(1); - this.nextPlayer(); - - this.drawCard(1); - this.nextPlayer(); - } + fillPlayerDecks(); } public GameService() { @@ -151,4 +144,14 @@ public class GameService { } } + public void fillPlayerDecks() { + for (int i = 0; i < 7; i++) { + this.drawCard(1); + this.nextPlayer(); + + this.drawCard(1); + this.nextPlayer(); + } + } + }