BlueBubble 1.0
A recommendation algorithm for movies based on a Netlfix database
|
a generic piece class. white is a boolean indicating the piece's color. legals is a vector indicating all legal movements. has_moved indicate if the piece has already move during this game More...
#include <piece.h>
Public Member Functions | |
piece (bool _white, coordinates _coord) | |
the constructor for the piece class | |
bool | is_possible (coordinates dest) |
verify if a move is within piece range | |
virtual bool | is_possible_attack (coordinates dest) |
verify if a move is within piece attack range | |
virtual void | needed_space (coordinates dest, std::vector< coordinates > *to_calculate) |
calculate the space needed for the piece to move | |
virtual void | print_piece () |
print the piece to the standard output | |
virtual void | canonical_print_piece () |
print the piece to the standard output in canonical form | |
virtual void | move (coordinates dest, bool debug_info) |
called to move the piece | |
coordinates | get_coord () |
retrieve the piece's coordinates | |
bool | get_color () |
retrieve the piece's color | |
bool | get_has_moved () |
retrieve if the piece has already moved during the game | |
piece_type | get_type () |
retrieve the piece's type | |
virtual std::vector< coordinates > | get_legals () |
retrieve the piece's legal moves | |
Protected Attributes | |
bool | white |
coordinates | coord |
std::vector< coordinates > | legals |
bool | has_moved |
piece_type | type |
a generic piece class. white is a boolean indicating the piece's color. legals is a vector indicating all legal movements. has_moved indicate if the piece has already move during this game
piece::piece | ( | bool | _white, |
coordinates | _coord ) |
|
virtual |
bool piece::get_color | ( | ) |
coordinates piece::get_coord | ( | ) |
bool piece::get_has_moved | ( | ) |
|
virtual |
piece_type piece::get_type | ( | ) |
retrieve the piece's type
bool piece::is_possible | ( | coordinates | dest | ) |
verify if a move is within piece range
dest | destination coordinates |
Definition at line 18 of file piece.cc.
|
virtual |
|
virtual |
called to move the piece
dest | the destination coordinates of the piece |
debug_info | print debug info to output when true |
Reimplemented in pawn.
Definition at line 57 of file piece.cc.
|
virtual |
|
virtual |
|
protected |
|
protected |
|
protected |