19 bool has_piece()
const;
20 std::optional<Piece> piece;
32 bool is_valid_move(
int start,
int end);
46 int w_num_pieces = 16;
47 int b_num_pieces = 16;
49 bool move_piece(
int start,
int end);
50 void move_piece_temp(
int start,
int end);
52 bool in_bounds(
int pos);
53 bool in_bounds(
int row,
int col);
56 void fill_starting_tiles();
57 void fill_test_tiles();
58 void place_starting_b_pieces();
59 void place_starting_w_pieces();
62 std::vector<std::pair<int, int>> get_all_pseudo_moves();
64 std::vector<std::pair<int, int>> get_all_legal_moves(std::vector<std::pair<int, int>> pseudo_legal);
66 void update_piece_counts(
const Tile &t);
68 void recalculate_attackable_tiles();
70 std::set<int> attackable_by_white;
72 std::set<int> attackable_by_black;
78 std::vector<std::pair<int, int>> reshape_vector(std::vector<int> &possible_moves,
int start);
int w_king_index
Store for a fast way to test for checks/mate.
Definition: chessboard.h:43
bool white_to_move
True: white's turn | False: black's turn.
Definition: chessboard.h:41
Used to create, store, and make changes to a game state.
Definition: chessboard.h:24
Comprises a Chessboard's game state, can hold a Piece.
Definition: chessboard.h:18
int b_king_index
Store for a fast way to test for checks/mate.
Definition: chessboard.h:45
int selected_piece_index
Used for highlighting within graphics and also executing moves.
Definition: chessboard.h:39
Handles all SDL2 functionalities require to visualize the game.
Finds possible moves given a Piece.
std::vector< Tile > chessboard
Game state.
Definition: chessboard.h:37