-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChessBot.h
More file actions
34 lines (28 loc) · 855 Bytes
/
ChessBot.h
File metadata and controls
34 lines (28 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Created by robbe on 17-1-2021.
//
#ifndef SCHAKEN_CHESSBOT_H
#define SCHAKEN_CHESSBOT_H
#include "sharedtypes.h"
typedef std::pair<SchaakStuk*, Tile> Move;
class ChessBot {
public:
ChessBot(Game*, ChessBoard*);
bool ai_move(ZW);
private:
void debug(const std::string&, int=0) const;
int ai_count_empty_start_tiles(ZW) const;
int ai_sum_of_threatened_pieces(ZW) const;
bool ai_resolve_check(ZW);
bool ai_move_piece(Move) const;
bool ai_move_leads_to_mate(Move) const;
bool ai_move_leads_to_check(Move, ZW) const;
bool ai_resolve_threatened_piece(SchaakStuk*);
bool ai_can_take_attacker(SchaakStuk*, SchaakStuk*) const;
bool ai_piece_covered(SchaakStuk*) const;
bool ai_safe_move(Move) const;
bool debugBot_ = false;
ChessBoard* scene_;
Game* game_;
};
#endif //SCHAKEN_CHESSBOT_H