From 7791bac6fbef01c47db7d0fdc08ec211bcd85594 Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Sun, 4 Feb 2024 18:15:29 +0100 Subject: [PATCH] botCanPlayCards --- src/main/java/de/hsfulda/onses/services/PlayerService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/hsfulda/onses/services/PlayerService.java b/src/main/java/de/hsfulda/onses/services/PlayerService.java index 089e50c..09b9f91 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -63,7 +63,9 @@ public class PlayerService { public void botMove() { for (int i = 0; i < this.playerList.getLast().getPlayerDeck().size(); i++) { if (getGame().getGameService().legalMove(this.playerList.getLast().getPlayerDeck().get(i))) { - this.removeCardFromPlayerDeck(this.playerList.getLast().getPlayerDeck().get(i)); + Card playCard = this.playerList.getLast().getPlayerDeck().get(i); + this.removeCardFromPlayerDeck(playCard); + getGame().getGameService().playCard(playCard); break; } }