#pragma once #include "SDL2/SDL.h" #include #include #include "app_consts.hpp" #include "piece.hpp" class Board { public: Board(); Board(std::string board_fen); void load_FEN(std::string board_fen); std::string make_FEN(); void draw_board(SDL_Surface* dest_surface); Team get_active_color(); Piece get_piece(int x, int y); Piece get_piece(int space); bool get_able_to_castle(Team team, Type board_half); int get_en_passant(); int get_half_turn_count(); int get_full_turn_count(); void set_selected_space(int x, int y); void set_selected_space(int space); void get_selected_space(int* x, int* y); int get_selected_space(); std::vector get_moves_for_space(int x, int y, bool check_for_check); std::vector get_moves_for_space(int space, bool check_for_check); bool is_check(Team team); bool is_mate(Team team); void do_move(int space_from, int space_to, bool holding_k); private: Piece game_board[BOARD_SIZE][BOARD_SIZE]; Team active_color; bool able_to_castle[2][2]; int en_passant; int half_turn_count, full_turn_count; int selected_space; MoveType can_move(int space_from, int space_to); bool does_move_solve_check(int space_from, int space_to); };