SchrodingersChess/board.hpp

49 lines
1.1 KiB
C++
Executable File

#pragma once
#include <SDL2/SDL.h>
#include <string>
#include <vector>
#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<int> get_moves_for_space(int x, int y);
std::vector<int> get_moves_for_space(int space);
bool is_check(Team team);
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);
};