-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubPiece.h
More file actions
145 lines (115 loc) · 3.59 KB
/
Copy pathSubPiece.h
File metadata and controls
145 lines (115 loc) · 3.59 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#ifndef SUBPIECE_H
#define SUBPIECE_H
#include<string>
#include"Piece.h"
using namespace std;
/*
KING SUBPIECE
*/
class King : public Piece {
public:
King(string colour, char sym, string name, int rank, int file) : Piece(colour, sym, name, rank, file) {};
/*
checkLogic()
as described in Piece.h - provides the combination of turn logic of a King subpiece
*/
int checkLogic(int d_rank, int d_file, bool verbose) override;
/*
checkContext()
as described in Piece.h - provides the interaction to surroundings of a King subpiece
*/
int checkContext(Piece* board_ref[8][8], int d_rank, int d_file, bool verbose) override;
};
/*
QUEEN SUBPIECE
*/
class Queen : public Piece {
public:
Queen(string colour, char sym, string name, int rank, int file) : Piece(colour, sym, name, rank, file) {};
/*
checkLogic()
as described in Piece.h - provides the combination of turn logic of a Queen subpiece
*/
int checkLogic(int d_rank, int d_file, bool verbose) override;
/*
checkContext()
as described in Piece.h - provides the interaction to surroundings of a Queen subpiece
*/
int checkContext(Piece* board_ref[8][8], int d_rank, int d_file, bool verbose) override;
};
/*
BISHOP SUBPIECE
*/
class Bishop : public Piece {
public:
Bishop(string colour, char sym, string name, int rank, int file) : Piece(colour, sym, name, rank, file) {};
/*
checkLogic()
as described in Piece.h - provides the combination of turn logic of a Bishop subpiece
*/
int checkLogic(int d_rank, int d_file, bool verbose) override;
/*
checkContext()
as described in Piece.h - provides the interaction to surroundings of a Bishop subpiece
*/
int checkContext(Piece* board_ref[8][8], int d_rank, int d_file, bool verbose) override;
};
/*
KNIGHT SUBPIECE
*/
class Knight : public Piece {
public:
Knight(string colour, char sym, string name, int rank, int file) : Piece(colour, sym, name, rank, file) {};
/*
checkLogic()
as described in Piece.h - provides the combination of turn logic of a Knight subpiece
*/
int checkLogic(int d_rank, int d_file, bool verbose) override;
/*
checkContext()
as described in Piece.h - provides the interaction to surroundings of a Knight subpiece
*/
int checkContext(Piece* board_ref[8][8], int d_rank, int d_file, bool verbose) override;
};
/*
ROOK SUBPIECE
*/
class Rook : public Piece {
public:
Rook(string colour, char sym, string name, int rank, int file) : Piece(colour, sym, name, rank, file) {};
/*
checkLogic()
as described in Piece.h - provides the combination of turn logic of a Rook subpiece
*/
int checkLogic(int d_rank, int d_file, bool verbose) override;
/*
checkContext()
as described in Piece.h - provides the interaction to surroundings of a Rook subpiece
*/
int checkContext(Piece* board_ref[8][8], int d_rank, int d_file, bool verbose) override;
};
/*
PAWN SUBPIECE
*/
class Pawn : public Piece {
private:
bool first_move = true;
public:
Pawn(string colour, char sym, string name, int rank, int file) : Piece(colour, sym, name, rank, file) {};
/*
checkLogic()
as described in Piece.h - provides the combination of turn logic of a Pawn subpiece
*/
int checkLogic(int d_rank, int d_file, bool verbose) override;
/*
checkContext()
as described in Piece.h - provides the interaction to surroundings of a Pawn subpiece
*/
int checkContext(Piece* board_ref[8][8], int d_rank, int d_file, bool verbose) override;
/*
toggleTurn()
after first turn, pawn moves turn logic (can't advance by 2)
*/
void toggleTurn() {this->first_move = false;}
};
#endif