-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChessBoard.h
53 lines (39 loc) · 935 Bytes
/
ChessBoard.h
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
42
43
44
45
46
47
48
49
50
51
52
53
/*
* EnigmaChess
* ------------------
* Created by Luis G.
*/
#ifndef CHESSBOARD_H
#define CHESSBOARD_H
#include "Piece.h"
#include "PrecomputedData.h"
#include <iostream>
#include <unordered_map>
class ChessBoard{
public:
ChessBoard();
void initBoard(std::string s);
void clearBoard();
void display();
// FEN functions
void loadFEN(std::string s);
void strip_FEN(std::string s);
void setFEN(std::string s);
std::string getFEN();
char pieceAt(int idx);
void movePiece(int s, int e);
Chess::Piece pieces;
bool checkPawn(int s, int e);
bool checkRook(int s, int e);
void changeTurn();
/* @todo: finish board class */
bool isCheck(int checkColor);
bool isCheckmate(int checkColor);
char curTurn;
~ChessBoard();
private:
char** board_array;
std::unordered_map<int, int> m;
std::string startFEN;
};
#endif // CHESSBOARD_H