Remove xxx_of_color() helpers

They hide the underlying uniform function call with
no benefit.

A little bit more verbose but now is clear what happens.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-02-17 10:54:47 +01:00
parent f32992f88c
commit 2c955f25de
6 changed files with 23 additions and 47 deletions

View File

@@ -467,8 +467,8 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) {
illegal = true;
if ( square_file(to) == FILE_B
&& ( pos.piece_on(to + DELTA_W) == rook_of_color(them)
|| pos.piece_on(to + DELTA_W) == queen_of_color(them)))
&& ( pos.piece_on(to + DELTA_W) == piece_of_color_and_type(them, ROOK)
|| pos.piece_on(to + DELTA_W) == piece_of_color_and_type(them, QUEEN)))
illegal = true;
return !illegal;
@@ -888,8 +888,8 @@ namespace {
if ( Side == QUEEN_SIDE
&& square_file(rsq) == FILE_B
&& ( pos.piece_on(relative_square(us, SQ_A1)) == rook_of_color(them)
|| pos.piece_on(relative_square(us, SQ_A1)) == queen_of_color(them)))
&& ( pos.piece_on(relative_square(us, SQ_A1)) == piece_of_color_and_type(them, ROOK)
|| pos.piece_on(relative_square(us, SQ_A1)) == piece_of_color_and_type(them, QUEEN)))
illegal = true;
if (!illegal)