-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueen.cpp
More file actions
32 lines (25 loc) · 700 Bytes
/
queen.cpp
File metadata and controls
32 lines (25 loc) · 700 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
#include "queen.h"
char Queen::print() const {
if (this->colour == white) {
return 'Q';
} else if (this->colour == black) {
return 'q';
} else {
return '?';
}
}
Name Queen::get_name() const {
return queen;
}
bool Queen::check_move(Cube chessboard[5][5][5], int const dst_rank, int const dst_file, int const dst_level) const {
if (Bishop::check_move(chessboard, dst_rank, dst_file, dst_level)) {
return true;
}
if (Rook::check_move(chessboard, dst_rank, dst_file, dst_level)) {
return true;
}
if (Unicorn::check_move(chessboard, dst_rank, dst_file, dst_level)) {
return true;
}
return false;
}