Retire enum Direction

Use SquareDelta instead

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-12-26 12:41:30 +01:00
parent f08a6eed0d
commit cb7f20913e
4 changed files with 34 additions and 55 deletions

View File

@@ -638,9 +638,9 @@ bool Position::pl_move_is_legal(Move m, Bitboard pinned) const {
// A non-king move is legal if and only if it is not pinned or it
// is moving along the ray towards or away from the king.
return ( !pinned
|| !bit_is_set(pinned, from)
|| (direction_between_squares(from, king_square(us)) == direction_between_squares(move_to(m), king_square(us))));
return !pinned
|| !bit_is_set(pinned, from)
|| squares_aligned(from, move_to(m), king_square(us));
}
@@ -698,7 +698,7 @@ bool Position::move_is_check(Move m, const CheckInfo& ci) const {
{
// For pawn and king moves we need to verify also direction
if ( (pt != PAWN && pt != KING)
||(direction_between_squares(from, ci.ksq) != direction_between_squares(to, ci.ksq)))
|| !squares_aligned(from, to, ci.ksq))
return true;
}