Browse Source

addBotMove

main
fdai7793 11 months ago
parent
commit
9cef72266e
  1. 9
      src/main/java/de/hsfulda/onses/services/PlayerService.java

9
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...
}
}
}
}
Loading…
Cancel
Save