Rename to the shorter but still
clear aligned()
No functional change.
-/// squares_aligned() returns true if the squares s1, s2 and s3 are aligned
+/// aligned() returns true if the squares s1, s2 and s3 are aligned
/// either on a straight or on a diagonal line.
/// either on a straight or on a diagonal line.
-inline bool squares_aligned(Square s1, Square s2, Square s3) {
+inline bool aligned(Square s1, Square s2, Square s3) {
return LineBB[s1][s2] & s3;
}
return LineBB[s1][s2] & s3;
}
// is moving along the ray towards or away from the king.
return !pinned
|| !(pinned & from)
// is moving along the ray towards or away from the king.
return !pinned
|| !(pinned & from)
- || squares_aligned(from, to_sq(m), king_square(us));
+ || aligned(from, to_sq(m), king_square(us));
{
// For pawn and king moves we need to verify also direction
if ( (pt != PAWN && pt != KING)
{
// For pawn and king moves we need to verify also direction
if ( (pt != PAWN && pt != KING)
- || !squares_aligned(from, to, king_square(~sideToMove)))
+ || !aligned(from, to, king_square(~sideToMove)))
// We exclude the trivial case where a sliding piece does in two moves what
// it could do in one move: eg. Ra1a2, Ra2a3.
if ( m2to == m1from
// We exclude the trivial case where a sliding piece does in two moves what
// it could do in one move: eg. Ra1a2, Ra2a3.
if ( m2to == m1from
- || (m1to == m2from && !squares_aligned(m1from, m2from, m2to)))
+ || (m1to == m2from && !aligned(m1from, m2from, m2to)))
return true;
// Second one moves through the square vacated by first one
return true;
// Second one moves through the square vacated by first one