4#include <SFML/Graphics.hpp>
78 void highlight(
int pieceIndex, sf::RenderWindow& window,
Board& board);
97 void draw(sf::RenderWindow& window);
130 bool opponentPiece(
int x,
int y,
const sf::Color& colorToCheck);
Represents the game board and its functionality.
Definition board.h:21
Player & getRedPlayer()
Getter for the red player.
int minimax(Board &board, int depth, bool computerPlayer)
Minimax algorithm to evaluate the board and choose the best move.
Definition board.cpp:343
bool endgame()
Checks if the game has ended.
Definition board.cpp:187
MoveNode MinMaxTree(Board &board, int depth, bool computerPlayer)
Implements the Minimax algorithm to search for the best move.
Definition board.cpp:248
void ComputerMove()
Executes the computer's move.
Definition board.cpp:374
static constexpr int size
Definition board.h:172
void draw(sf::RenderWindow &window)
Draws the game board and pieces on the SFML window.
Definition board.cpp:195
Move BestMove(int depth, bool computerPlayer)
Finds the best move using the Minimax algorithm.
Definition board.cpp:289
void makeMove(Board &board, const Move &move)
Makes a move on the board.
Definition board.cpp:403
bool isPieceAt(int x, int y) const
Checks if there is a piece at the given coordinates.
Definition board.cpp:51
Piece pieces[24]
Definition board.h:171
int evaluateBoard(Board &board)
Evaluates the current state of the board.
Definition board.cpp:225
Player & redPlayer
Reference to the red player.
Definition board.h:168
const int depth
Depth for the minimax algorithm.
Definition board.h:178
void InitializeGame(Player &redPlayer, Player &blackPlayer)
Initializes the game board with pieces.
Definition board.cpp:17
Player & getBlackPlayer()
Getter for the black player.
void highlight(int pieceIndex, sf::RenderWindow &window, Board &board)
Highlights the possible moves for a selected piece.
Definition board.cpp:138
bool opponentPiece(int x, int y, const sf::Color &colorToCheck)
Checks if a piece at a certain position belongs to the opponent.
Definition board.cpp:300
bool validarity(const Piece &piece, int x, int y)
Checks the validity of a move for a given piece.
Definition board.cpp:67
int MousePosition(int mouseX, int mouseY)
Generates the index of the piece that was clicked by the mouse.
Definition board.cpp:385
Board(Player &red, Player &black)
Constructor for the Board class.
Definition board.cpp:8
std::vector< Move > generateMoves(Board &board)
Generates all possible moves for the current board state.
Definition board.cpp:313
void inputdata(sf::RenderWindow &window)
Handles player input for moving pieces.
Definition board.cpp:85
Player & blackPlayer
Definition board.h:170
int selectedPieceIndex
Index of the currently selected piece.
Definition board.h:177
int numberofmoves(Player *player)
Counts the number of possible moves for a player.
Definition board.cpp:171
Class representing a move in the game.
Definition move.h:7
Class representing a node in the MinMax tree.
Definition movenode.h:10
Represents a checker piece on the board.
Definition piece.h:15
Class representing a player in the game.
Definition player.h:9
Header file for the Piece class, which represents a checker piece on the board.