|
| static SquareSet | getPawnAttackMask (Square sq, Color pawnColor) noexcept |
| | Returns a set of squares that a pawn can attack.
|
| |
| static SquareSet | getPawnAttackerMask (Square sq, Color pawnColor) noexcept |
| | Returns a set of squares from which a pawn can attack.
|
| |
| template<Color pawnColor, bool captureToRight> |
| static constexpr SquareSet | getPawnAttackersMask (SquareSet capturable) noexcept |
| | For a given set of squares, returns the squares where pawns can attack the given squares.
|
| |
| static SquareSet | getKnightAttackMask (Square sq) noexcept |
| | Returns the set of squares a knight can attack.
|
| |
| static SquareSet | getBishopAttackMask (Square sq, SquareSet occupancyMask) noexcept |
| | Returns the set of squares a bishop can attack, given also a set of occupied squares on board.
|
| |
| static SquareSet | getRookAttackMask (Square sq, SquareSet occupancyMask) noexcept |
| | Returns the set of squares a rook can attack, given also a set of occupied squares on board.
|
| |
| static SquareSet | getQueenAttackMask (Square sq, SquareSet occupancyMask) noexcept |
| |
| static SquareSet | getKingAttackMask (Square sq) noexcept |
| | Returns the set of squares a king can attack.
|
| |
| static bool | pinCheck (Square src, SquareSet dstBit, Square kingSq, SquareSet pinnedPieces) noexcept |
| | Checks whether a move by a possibly pinned piece does not expose a check.
|
| |
| static SquareSet | determineAttackers (const SquareSet occupancyMask, const SquareSet turnColorMask, const SquareSet pawns, const SquareSet knights, const SquareSet bishops, const SquareSet rooks, const SquareSet kings, const Square sq, const Color turn) noexcept |
| |
| static void | determineCheckersAndPins (SquareSet occupancyMask, SquareSet turnColorMask, SquareSet pawns, SquareSet knights, SquareSet bishops, SquareSet rooks, Square epSquare, SquareSet epCapturable, Square kingSq, Color turn, SquareSet &out_checkers, SquareSet &out_pinnedPieces) noexcept |
| | Determines all checkers and pinners.
|
| |
| static SquareSet | determineAttackedSquares (SquareSet occupancyMask, SquareSet pawns, SquareSet knights, SquareSet bishops, SquareSet rooks, Square king, Color turn) noexcept |
| | Determines all attacked squares.
|
| |
Returns the set of squares a bishop can attack, given also a set of occupied squares on board.
- Parameters
-
| [in] | sq | Bishop square |
| [in] | occupancyMask | Set of occupied squares |
- Returns
- Set of attacked squares
Per every diagonal direction from sq, the set of attacked squares is all squares between sq and the first occupied square (if any) including the occupied square. If no occupied squares are in that direction, then all squares in that direction are included.
Occupancy of sq is ignored.
The implementation used is as follows:
Example
Returns the set of squares a rook can attack, given also a set of occupied squares on board.
- Parameters
-
| [in] | sq | Rook square |
| [in] | occupancyMask | Set of occupied squares |
- Returns
- Set of attacked squares
Per horizontal/vertical direction from sq, the set of attacked squares is all squares between sq and the first occupied square (if any) including the occupied square. If no occupied squares are in that direction, then all squares in that direction are included.
Occupancy of sq is ignored.
The implementation used is as follows:
Example