Browse Source

botCanPlayCards

main
fdai7793 11 months ago
parent
commit
7791bac6fb
  1. 4
      src/main/java/de/hsfulda/onses/services/PlayerService.java

4
src/main/java/de/hsfulda/onses/services/PlayerService.java

@ -63,7 +63,9 @@ public class PlayerService {
public void botMove() { public void botMove() {
for (int i = 0; i < this.playerList.getLast().getPlayerDeck().size(); i++) { for (int i = 0; i < this.playerList.getLast().getPlayerDeck().size(); i++) {
if (getGame().getGameService().legalMove(this.playerList.getLast().getPlayerDeck().get(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; break;
} }
} }

Loading…
Cancel
Save