Browse Source

refactoring: move one nextTurn into drawCard

main
fdai7920 11 months ago
parent
commit
620b82e202
  1. 5
      src/main/java/de/hsfulda/onses/services/GameService.java

5
src/main/java/de/hsfulda/onses/services/GameService.java

@ -36,6 +36,9 @@ public class GameService {
player.getPlayerDeck().add(game.getDrawCardDeck().getFirst()); player.getPlayerDeck().add(game.getDrawCardDeck().getFirst());
game.getDrawCardDeck().removeFirst(); game.getDrawCardDeck().removeFirst();
} }
if (amount != 1) {
nextPlayer();
}
} }
public void playCard(Player player, Card card) public void playCard(Player player, Card card)
{ {
@ -63,7 +66,6 @@ public class GameService {
if (card.getValue() == Card.Value.DRAWTWO) { if (card.getValue() == Card.Value.DRAWTWO) {
nextPlayer(); nextPlayer();
drawCard(2); drawCard(2);
nextPlayer();
} }
// ChooseDraw // ChooseDraw
if (card.getValue() == Card.Value.CHOOSEDRAW) { if (card.getValue() == Card.Value.CHOOSEDRAW) {
@ -72,7 +74,6 @@ public class GameService {
game.changeLastPlayedCardColor(color); game.changeLastPlayedCardColor(color);
nextPlayer(); nextPlayer();
drawCard(4); drawCard(4);
nextPlayer();
} }
} }

Loading…
Cancel
Save