BlueBubble 1.0
A recommendation algorithm for movies based on a Netlfix database
Loading...
Searching...
No Matches
queen.h
Go to the documentation of this file.
1#ifndef QUEEN
2#define QUEEN
5#include "piece.h"
6#include <vector>
7
9class queen : public piece{
10 public:
11 queen(bool _white, coordinates _coord):
12 piece(_white,_coord)
13 {
15 for(int i = -7; i < 8; i++)
16 if(i!=0){
17 // Bishop moves
18 legals.push_back(coordinates(i,i));
19 legals.push_back(coordinates(i,-i));
20 // Rook moves
21 legals.push_back(coordinates(0,i));
22 legals.push_back(coordinates(i,0));
23 }
24 }
25 void needed_space(coordinates dest, std::vector<coordinates> *to_calculate) override;
26 void print_piece() override;
27 void canonical_print_piece() override;
28};
29
30#endif
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
the queen piece class.
Definition queen.h:9
void canonical_print_piece() override
print the piece to the standard output in canonical form
Definition queen.cc:70
void print_piece() override
print the piece to the standard output
Definition queen.cc:61
queen(bool _white, coordinates _coord)
Definition queen.h:11
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 queen.cc:11
@ queen_type
Definition piece.h:8