From 9cef72266e5df5dd50609fcc38b7c03bd58055fe Mon Sep 17 00:00:00 2001 From: fdai7793 Date: Sat, 3 Feb 2024 18:50:30 +0100 Subject: [PATCH] addBotMove --- .../java/de/hsfulda/onses/services/PlayerService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/de/hsfulda/onses/services/PlayerService.java b/src/main/java/de/hsfulda/onses/services/PlayerService.java index 3c3fb47..ce5b5e8 100644 --- a/src/main/java/de/hsfulda/onses/services/PlayerService.java +++ b/src/main/java/de/hsfulda/onses/services/PlayerService.java @@ -3,6 +3,7 @@ package de.hsfulda.onses.services; import de.hsfulda.onses.models.Game; import de.hsfulda.onses.models.Player; import de.hsfulda.onses.models.Card; +import de.hsfulda.onses.services.GameService; import java.util.ArrayList; @@ -58,4 +59,12 @@ public class PlayerService { } player.getPlayerDeck().remove(card); } + + public void botMove() { + for (int i = 0; i < this.playerList.getLast().getPlayerDeck().size(); i++) { + if (getGame().getGameService().legalMove(this.playerList.getLast().getPlayerDeck().get(i))) { + //do something... + } + } + } }