Exemplo n.º 1
0
        internal static BitBoard GetAllTargets(byte pieceColor, BitBoard bishops, Board board)
        {
            BitBoard occupiedSquares = board.OccupiedSquares;
            BitBoard targets = Constants.Empty;
            int square;

            square = BitBoard.BitScanForward(bishops);

            targets |= MovePackHelper.GetA1H8DiagonalAttacks(occupiedSquares, square);
            targets |= MovePackHelper.GetH1A8DiagonalAttacks(occupiedSquares, square);

            return targets & ~board.GetPlayerPieces();
        }
Exemplo n.º 2
0
        internal static BitBoard GetAllTargets(byte pieceColor, BitBoard rooks, Board board)
        {
            BitBoard occupiedSquares = board.OccupiedSquares;
            BitBoard targets = Constants.Empty;
            int square;

            square = BitBoard.BitScanForward(rooks);

            targets |= MovePackHelper.GetRankAttacks(occupiedSquares, square);
            targets |= MovePackHelper.GetFileAttacks(occupiedSquares, square);

            return targets & ~board.GetPlayerPieces();
        }
Exemplo n.º 3
0
        internal static BitBoard GetAllTargets(byte pieceColor, BitBoard knights, Board board)
        {
            BitBoard targets = MovePackHelper.KnightAttacks[(BitBoard.BitScanForward(knights))];

            return targets & ~board.GetPlayerPieces();
        }
Exemplo n.º 4
0
 internal static BitBoard GetAllTargets(byte pieceColor, BitBoard king, Board board)
 {
     BitBoard kingMoves = MovePackHelper.KingAttacks[(BitBoard.BitScanForward(king))];
     return kingMoves & ~board.GetPlayerPieces();
 }