Browse Source

add gameService drawCard

main
fdai7906 11 months ago
parent
commit
16aff085c0
  1. 11
      src/main/java/de/hsfulda/onses/services/GameService.java

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

@ -24,7 +24,16 @@ public class GameService {
game.getPlayerService().nextTurn(); game.getPlayerService().nextTurn();
} }
public void drawCard(int amount) { public void drawCard(int amount) {
Player player = null;
if (game.getPlayerService().getCurrentTurn()) {
player = game.getPlayerService().getPlayerList().getFirst();
} else {
player = game.getPlayerService().getPlayerList().getLast();
}
for (int i = 0; i < amount; i++) {
player.getPlayerDeck().add(game.getDrawCardDeck().getFirst());
game.getDrawCardDeck().removeFirst();
}
} }
public void playCard(Player player, Card card) public void playCard(Player player, Card card)
{ {

Loading…
Cancel
Save