Piezas.cpp
/**
 * Returns what piece is at the provided coordinates, or Blank if there
 * are no pieces there, or Invalid if the coordinates are out of bounds
**/
Returns what piece is at the provided coordinates, or Blank if there
are no pieces there, or Invalid if the coordinates are out of bounds
Returns what piece is at the provided coordinates or Blank if there are no pieces there or Invalid if the coordinates are out of bounds
Piece Piezas::pieceAt(int row, int column)
{
    const bool row_invalid = row < 0 || row >= BOARD_ROWS;
    const bool col_invalid = column < 0 || column >= BOARD_COLS;
    if (row_invalid || col_invalid) {
        return Invalid;
    } else {
        return board[row][column];
    }
}
Piece Piezas :: pieceAt ( int row , int column ) { const bool row_invalid = row < 0 || row >= BOARD_ROWS ; const bool col_invalid = column < 0 || column >= BOARD_COLS ; if ( row_invalid || col_invalid ) { return Invalid ; } else { return board [ row ] [ column ] ; } }
Returns what piece is at the provided coordinates, or Blank if there
 are no pieces there, or Invalid if the coordinates are out of bounds
Returns what piece is at the provided coordinates or Blank if there are no pieces there or Invalid if the coordinates are out of bounds
// This can return either the piece or a Blank. // By default when the board is cleared, all values are set to Blank.