9 white(_white), coord(_coord)
20 for(
int i = 0; i <
legals.size(); i++){
31 for(
int i = 0; i <
legals.size(); i++){
46 std::cout <<
"undefined piece";
51 std::cout <<
"undefined piece";
63 std::cout <<
"Piece info : white=" <<
white << std::endl;
64 std::cout <<
"Legal moves :" << std::endl;
65 for(
int i = 0; i <
legals.size(); i++){
66 std::cout <<
"x=" <<
legals[i].get_x() <<
" y=" <<
legals[i].get_y() << std::endl;
a class representing coordinates
int get_x()
a function to get the x-axis attribute
int get_y()
a function to get the y-axis attribute
void move(coordinates move_to)
change the coordinate values to move the associated piece
bool is_possible(coordinates dest)
verify if a move is within piece range
bool get_color()
retrieve the piece's color
virtual void move(coordinates dest, bool debug_info)
called to move the piece
virtual std::vector< coordinates > get_legals()
retrieve the piece's legal moves
virtual bool is_possible_attack(coordinates dest)
verify if a move is within piece attack range
piece_type get_type()
retrieve the piece's type
coordinates get_coord()
retrieve the piece's coordinates
piece(bool _white, coordinates _coord)
the constructor for the piece class
virtual void canonical_print_piece()
print the piece to the standard output in canonical form
bool get_has_moved()
retrieve if the piece has already moved during the game
virtual void print_piece()
print the piece to the standard output
std::vector< coordinates > legals
virtual void needed_space(coordinates dest, std::vector< coordinates > *to_calculate)
calculate the space needed for the piece to move
piece_type
Represent a piece type. Undefined for default piece.
bool is_corresponding(coordinates start, coordinates end, coordinates movement)
verify if a movement is corresponding to a starting and ending coordinates