예제 #1
0
 public static BitBoard GetAttacks(this Square square, EPieceType pieceType, BitBoard occupied = new BitBoard())
 {
     return(pieceType == EPieceType.Knight || pieceType == EPieceType.King
         ? PseudoAttacksBB[pieceType.ToInt(), square.ToInt()]
         : pieceType == EPieceType.Bishop
             ? square.BishopAttacks(occupied)
             : pieceType == EPieceType.Rook
                 ? square.RookAttacks(occupied)
                 : pieceType == EPieceType.Queen
                     ? square.QueenAttacks(occupied)
                     : Zero);
 }
예제 #2
0
 public static ref BitBoard PseudoAttack(this Square @this, EPieceType pieceType) => ref PseudoAttacksBB[pieceType.ToInt(), @this.ToInt()];