2022-04-15 02:40:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-04-16 03:13:15 +00:00
|
|
|
#include "SDL2/SDL.h"
|
2022-04-15 02:40:00 +00:00
|
|
|
|
|
|
|
#include "board.hpp"
|
|
|
|
|
|
|
|
class Game
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Game(SDL_Window* window, SDL_Surface* surface);
|
|
|
|
Game(SDL_Window* window, SDL_Surface* surface, std::string board_fen);
|
|
|
|
|
|
|
|
void run();
|
|
|
|
private:
|
|
|
|
void tick();
|
|
|
|
void draw();
|
|
|
|
|
2022-04-16 03:13:15 +00:00
|
|
|
void process_click(int x, int y);
|
|
|
|
|
|
|
|
void do_ai_move();
|
|
|
|
int minimax(Board current_board, int depth, int a, int b, bool maximizing);
|
|
|
|
int board_heuristic(Board current_board);
|
|
|
|
|
2022-04-15 02:40:00 +00:00
|
|
|
SDL_Window* window;
|
|
|
|
SDL_Surface* surface;
|
|
|
|
|
|
|
|
Board board;
|
|
|
|
|
|
|
|
bool running;
|
2022-04-16 03:13:15 +00:00
|
|
|
|
|
|
|
bool holding_k;
|
2022-04-15 02:40:00 +00:00
|
|
|
};
|