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