mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Introduce enum SquareColor
Square and piece colors are two different things, so use different types to avoid misunderstandings. Suggested by Tord. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -135,8 +135,8 @@ inline Rank relative_rank(Color c, Square s) {
|
||||
return square_rank(relative_square(c, s));
|
||||
}
|
||||
|
||||
inline Color square_color(Square s) {
|
||||
return Color((int(square_file(s)) + int(square_rank(s))) & 1);
|
||||
inline SquareColor square_color(Square s) {
|
||||
return SquareColor((int(square_file(s)) + int(square_rank(s))) & 1);
|
||||
}
|
||||
|
||||
inline bool same_color_squares(Square s1, Square s2) {
|
||||
|
||||
Reference in New Issue
Block a user