BlueBubble 1.0
A recommendation algorithm for movies based on a Netlfix database
Loading...
Searching...
No Matches
bishop.h
Go to the documentation of this file.
1#ifndef BISHOP
2#define BISHOP
5#include "piece.h"
6#include <vector>
7
9class bishop : public piece{
10 public:
11 bishop(bool _white, coordinates _coord):
12 piece(_white,_coord)
13 {
15 for(int i = -7; i < 8; i++)
16 if(i!=0){
17 legals.push_back(coordinates(i,i));
18 legals.push_back(coordinates(i,-i));
19 }
20 }
21 void needed_space(coordinates dest, std::vector<coordinates> *to_calculate) override;
22 void print_piece() override;
23 void canonical_print_piece() override;
24};
25
26#endif
the bishop piece class.
Definition bishop.h:9
void canonical_print_piece() override
print the piece to the standard output in canonical form
Definition bishop.cc:41
void print_piece() override
print the piece to the standard output
Definition bishop.cc:32
void needed_space(coordinates dest, std::vector< coordinates > *to_calculate) override
calculate a list of empty space coordinates needed for the move to be legal, assuming the move is pos...
Definition bishop.cc:11
bishop(bool _white, coordinates _coord)
Definition bishop.h:11
a class representing coordinates
Definition coordinates.h:5
a generic piece class. white is a boolean indicating the piece's color. legals is a vector indicating...
Definition piece.h:11
piece_type type
Definition piece.h:17
std::vector< coordinates > legals
Definition piece.h:15
@ bishop_type
Definition piece.h:8