Check interceptions and pin checks.
More...
#include <bitboard-intercepts.h>
Check interceptions and pin checks.
◆ getInterceptSquares()
| static SquareSet hoover_chess_utils::pgn_reader::Intercepts::getInterceptSquares |
( |
Square |
kingSq, |
|
|
Square |
checkerSq |
|
) |
| |
|
inlinestaticnoexcept |
Returns the set of squares that intercepts a check.
- Parameters
-
| [in] | kingSq | King square |
| [in] | checkerSq | Checker square. May be Square::NONE. |
- Returns
- The set of intercept squares or
SquareSet::all() when the checker is Square::NONE.
The set of squares that intercept a check are:
checkerSq (assume captured)
- If
checkerSq is along a ray direction from kingSq, then all squares in between (but not including kingSq)
Illustration
Where:
K = the checked king
C = the checker
- shaded = the intercept squares
◆ getPinRestiction()
template<bool pinned>
| static SquareSet hoover_chess_utils::pgn_reader::Intercepts::getPinRestiction |
( |
Square |
kingSq, |
|
|
Square |
pinnedSq |
|
) |
| |
|
inlinestaticnoexcept |
◆ getRay()
Returns a ray from king square to the direction of pinned piece square.
- Parameters
-
| [in] | kingSq | King square |
| [in] | pinnedSq | Square of the pinned piece |
- Precondition
- (Asserted)
kingSq → pinnedSq must be on the same rank, file, diagonal, or anti-diagonal.
The ray represents the squares that are valid for a pinned piece, as pinned piece can only be moved along the pin axis.
The documentation for this class was generated from the following file: