Package javachess.player
Class BotPlayer
java.lang.Object
javachess.player.BotPlayer
- All Implemented Interfaces:
Player
-
Constructor Summary
ConstructorsConstructorDescriptionBotPlayer(Game game, PieceColor color, int depth) Constructor for BotPlayer. -
Method Summary
Modifier and TypeMethodDescriptiongetBestMove(String fen, int depth) Fetches the best move from Stockfish API.getColor()Returns the color of the player.getMove()getPromoteTo(Cell pawnCell) static voidstatic boolean
-
Constructor Details
-
BotPlayer
Constructor for BotPlayer.- Parameters:
game- The game instance.color- The color of the player.
-
-
Method Details
-
getBestMove
Fetches the best move from Stockfish API.- Parameters:
fen- The FEN string to analyze.depth- The depth for engine to go to (must be less than 16).- Returns:
- The best move as a String, or null if not found.
- Throws:
Exception- in case of an HTTP or parsing error.
-
testConnection
public static boolean testConnection() -
main
-
getColor
Description copied from interface:PlayerReturns the color of the player. -
getMove
-
getPromoteTo
-