SchrodingersChess/game.hpp

35 lines
824 B
C++
Raw Normal View History

2022-04-15 02:40:00 +00:00
#pragma once
2022-04-19 02:27:16 +00:00
#include <mutex>
#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();
void process_click(int x, int y);
2022-04-19 19:14:24 +00:00
int do_ai_move();
2022-04-19 02:27:16 +00:00
static int minimax(Board current_board, int depth, int max_depth, int a, int b, bool maximizing);
static void minimax_evaluate(std::mutex& mut_result_check, Board current_board, int x, int y, int depth, int max_depth, int& best_move_weight, int& a, int& b, bool& a_eject, bool& b_eject, bool maximizing);
static int board_heuristic(Board current_board);
2022-04-15 02:40:00 +00:00
SDL_Window* window;
SDL_Surface* surface;
Board board;
bool running;
bool holding_k;
2022-04-15 02:40:00 +00:00
};