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