Chess
engine.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "agent.h"
9 #include "chessboard.h"
10 
11 class Graphics;
12 
14 class Engine {
15  public:
16  Engine(const std::string &title);
18  void run();
19 
20  private:
21  Graphics graphics;
23  Chessboard chessboard;
25  Agent agent;
26  bool running;
27 
29  void init();
31  void stop();
33  bool input();
35  int get_mouse_click(SDL_Event);
37  void handle_mouse_click(int);
39  void call_agent();
41  void handle_agent_move(std::pair<int, int>);
43  void set_possible_moves();
45  void test_for_checks();
46 
47  Engine(const Engine &other) = delete; // copy constructor
48  Engine &operator=(const Engine &rhs) = delete; // copy assignment
49  Engine(Engine &&other) = delete; // move constructor
50  Engine &operator=(Engine &&rhs) = delete; // move assignment
51 };
Contains main game loop and turn handling.
Definition: engine.h:14
Used to create, store, and make changes to a game state.
Definition: chessboard.h:24
Class used to programmatically produce a Chess move.
Definition: agent.h:31
Creates, stores, and makes changes to data for a game state.
Handles all SDL2 functionalities require to visualize the game.
Definition: graphics.h:18
How the Agent finds its move.
void run()
Game loop.
Definition: engine.cpp:23