the bishop piece class.
More...
#include <bishop.h>
the bishop piece class.
Definition at line 9 of file bishop.h.
◆ bishop()
Definition at line 11 of file bishop.h.
11 :
13 {
15 for(int i = -7; i < 8; i++)
16 if(i!=0){
19 }
20 }
a class representing coordinates
piece(bool _white, coordinates _coord)
the constructor for the piece class
std::vector< coordinates > legals
◆ canonical_print_piece()
void bishop::canonical_print_piece |
( |
| ) |
|
|
overridevirtual |
print the piece to the standard output in canonical form
Reimplemented from piece.
Definition at line 41 of file bishop.cc.
41 {
43 std::cout << "wB";
44 }else{
45 std::cout << "bB";
46 }
47}
◆ needed_space()
calculate a list of empty space coordinates needed for the move to be legal, assuming the move is possible
- Parameters
-
dest | destination coordinates |
- Returns
- a vector containing all coordinates to be verified
Reimplemented from piece.
Definition at line 11 of file bishop.cc.
11 {
14 int coord_x = -1;
15 int coord_y = -1;
16 for(int i = 1; i < abs(diff_x); i++){
17 if(diff_x > 0){
19 }else{
21 }
22 if(diff_y > 0){
24 }else{
26 }
27 to_calculate->push_back(
coordinates(coord_x,coord_y));
28 }
29}
int get_x()
a function to get the x-axis attribute
int get_y()
a function to get the y-axis attribute
◆ print_piece()
void bishop::print_piece |
( |
| ) |
|
|
overridevirtual |
print the piece to the standard output
Reimplemented from piece.
Definition at line 32 of file bishop.cc.
32 {
34 std::cout << "\u2657";
35 }else{
36 std::cout << "\u265D";
37 }
38}
The documentation for this class was generated from the following files: