-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathChessBoard.h
More file actions
41 lines (39 loc) · 1.29 KB
/
ChessBoard.h
File metadata and controls
41 lines (39 loc) · 1.29 KB
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
35
36
37
38
39
40
41
#ifndef _CHESSBOARD_H_
#define _CHESSBOARD_H_
#include "Piece.h"
#include "Move.h"
#include "Subject.h"
#include <utility>
class ChessBoard : public Subject {
private:
Piece* board[8][8];
void trySetPiece(Move move);
void resetMove(Move move);
bool isPotentialMove(Move move);
void afterMove(Move move);
bool checkLegalCastle(Move move, bool isKSCastle);
Move castlingKingMoveFactory(Move kingMove, pair<int, int> ending, bool isKSCastle);
vector<Move> prevMoves;
public:
~ChessBoard();
void init();
bool isPathClear(Move move);
bool isInCheck(bool white);
bool simulateMove(Move move);
Piece* getPiece(pair<int, int> square);
void setPiece(pair<int, int> square, Piece* piece);
bool checkInDanger(Piece* piece);
bool isOccupied(pair<int, int> square);
bool checkMoveLegal(Move move);
void printCLI();
void doMove(Move move);
bool isCheckMove(Move move);
bool isMovingOutOfDanger(Move move);
bool isInsufficientMaterial();
int getScore(bool white);
int scoredSimulateMove(Move move);
void simulateFutureMove(Move move);
void resetFutureMove(Move move);
void undo();
};
#endif