-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoard.h
63 lines (44 loc) · 1.41 KB
/
Board.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
54
55
56
57
58
59
60
61
62
63
//author: Gabriel Zapata
#ifndef BOARD_H_INCLUDED
#define BOARD_H_INCLUDED
#include "Tile.h"
#include "Piece.h"
#include "Tile.h"
class Board
{
private:
//array of tiles for a place fro each piece to go on.
Tile arra[8][8];
bool isCheckmate;
public:
Board();
//default constructor
void setup();
bool can_pawn_move(int fromX, int fromY, int toX, int toY);
bool can_bishop_move(int fromX, int fromY, int toX, int toY);
bool can_knight_move(int fromX, int fromY, int toX, int toY);
bool can_rook_move(int fromX, int fromY, int toX, int toY);
bool can_queen_move(int fromX, int fromY, int toX, int toY);
bool can_king_move(int fromX, int fromY, int toX, int toY);
//displays the board every other turn including the
//black & white pieces
void display();
//checks if the current player is inCheck which means they can
//only move the king
bool IsInCheck(int player);
bool canMove(int player);
void movePiece(int fromX, int fromY, int toX, int toY);
Tile& getTile(int x, int y){return arra[x][y];}
bool isValidPiece(int x, int y);
void setIsCheckmate(bool isCheckmate);
bool getIsCheckmate()const{return isCheckmate;}
};
/*
pawn = 100
bishop = 305
knight = 300
rook = 500
queen = 900
king = 200
*/
#endif // BOARD_H_INCLUDED