mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Retire operator|(File f, Rank r)
Use make_square() instead. Less fancy but more clear. No functional change.
This commit is contained in:
@@ -337,10 +337,6 @@ inline Square operator~(Square s) {
|
||||
return Square(s ^ SQ_A8); // Vertical flip SQ_A1 -> SQ_A8
|
||||
}
|
||||
|
||||
inline Square operator|(File f, Rank r) {
|
||||
return Square((r << 3) | f);
|
||||
}
|
||||
|
||||
inline CastlingRight operator|(Color c, CastlingSide s) {
|
||||
return CastlingRight(WHITE_OO << ((s == QUEEN_SIDE) + 2 * c));
|
||||
}
|
||||
@@ -353,6 +349,10 @@ inline Value mated_in(int ply) {
|
||||
return -VALUE_MATE + ply;
|
||||
}
|
||||
|
||||
inline Square make_square(File f, Rank r) {
|
||||
return Square((r << 3) | f);
|
||||
}
|
||||
|
||||
inline Piece make_piece(Color c, PieceType pt) {
|
||||
return Piece((c << 3) | pt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user