BlueBubble 1.0
A recommendation algorithm for movies based on a Netlfix database
Loading...
Searching...
No Matches
piece.h
Go to the documentation of this file.
1#ifndef PIECE
2#define PIECE
5#include <vector>
6
9
11class piece{
12 protected:
13 bool white;
15 std::vector<coordinates> legals;
18 public:
19 piece(bool _white, coordinates _coord);
20 bool is_possible(coordinates dest);
21 virtual bool is_possible_attack(coordinates dest);
22 virtual void needed_space(coordinates dest, std::vector<coordinates> *to_calculate);
23 virtual void print_piece();
24 virtual void canonical_print_piece();
25 virtual void move(coordinates dest,bool debug_info);
27 bool get_color();
28 bool get_has_moved();
30 virtual std::vector<coordinates> get_legals();
31};
32
33#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
bool is_possible(coordinates dest)
verify if a move is within piece range
Definition piece.cc:18
coordinates coord
Definition piece.h:14
bool get_color()
retrieve the piece's color
Definition piece.cc:79
virtual void move(coordinates dest, bool debug_info)
called to move the piece
Definition piece.cc:57
piece_type type
Definition piece.h:17
virtual std::vector< coordinates > get_legals()
retrieve the piece's legal moves
Definition piece.cc:97
virtual bool is_possible_attack(coordinates dest)
verify if a move is within piece attack range
Definition piece.cc:29
piece_type get_type()
retrieve the piece's type
Definition piece.cc:91
coordinates get_coord()
retrieve the piece's coordinates
Definition piece.cc:73
piece(bool _white, coordinates _coord)
the constructor for the piece class
Definition piece.cc:8
virtual void canonical_print_piece()
print the piece to the standard output in canonical form
Definition piece.cc:50
bool get_has_moved()
retrieve if the piece has already moved during the game
Definition piece.cc:85
bool has_moved
Definition piece.h:16
virtual void print_piece()
print the piece to the standard output
Definition piece.cc:45
bool white
Definition piece.h:13
std::vector< coordinates > legals
Definition piece.h:15
virtual void needed_space(coordinates dest, std::vector< coordinates > *to_calculate)
calculate the space needed for the piece to move
Definition piece.cc:40
piece_type
Represent a piece type. Undefined for default piece.
Definition piece.h:8
@ knight_type
Definition piece.h:8
@ queen_type
Definition piece.h:8
@ king_type
Definition piece.h:8
@ rook_type
Definition piece.h:8
@ pawn_type
Definition piece.h:8
@ bishop_type
Definition piece.h:8