From 351cdb37df09bd5b72af46d357e93ef4518caf50 Mon Sep 17 00:00:00 2001 From: fdai7736 Date: Thu, 8 Feb 2024 12:21:01 +0100 Subject: [PATCH] refactoring: fix remove card from bot --- src/main/java/de/hsfulda/onses/controllers/GameController.java | 1 - src/main/java/de/hsfulda/onses/services/PlayerService.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/hsfulda/onses/controllers/GameController.java b/src/main/java/de/hsfulda/onses/controllers/GameController.java index 0abedb7..fbf3b66 100644 --- a/src/main/java/de/hsfulda/onses/controllers/GameController.java +++ b/src/main/java/de/hsfulda/onses/controllers/GameController.java @@ -43,7 +43,6 @@ public class GameController implements Controller { playButton.setOnAction(e -> { Card cardToPlay = game.getPlayerService().getPlayerList().getFirst().getCurrentCard(); if(gameService.legalMove(cardToPlay)) { - System.out.println(cardToPlay.getPlayer()); if(cardToPlay.getPlayer() != null) { cardToPlay.getPlayer().removeCardFromPlayerDeck(cardToPlay); gameService.playCard(cardToPlay); diff --git a/src/main/java/de/hsfulda/onses/services/PlayerService.java b/src/main/java/de/hsfulda/onses/services/PlayerService.java index 14382d3..8b96412 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -57,7 +57,7 @@ public class PlayerService { } else { player = playerList.getLast(); } - player.getPlayerDeck().remove(card); + player.removeCardFromPlayerDeck(card); } public void botMove() {