Beispiel #1
0
 public static (SquareEnum From, SquareEnum To) GetRookRokadeSquares(this SquareEnum kingMoveSquare, bool isWhiteToMove)
 {
     if (kingMoveSquare.File() == 6)
     {
         return(isWhiteToMove ? SquareEnum.h1 : SquareEnum.h8, (SquareEnum)((int)kingMoveSquare - 1));
     }
     else
     {
         return(isWhiteToMove ? SquareEnum.a1 : SquareEnum.a8, (SquareEnum)((int)kingMoveSquare + 1));
     }
 }
Beispiel #2
0
 public static bool IsKingsideRokadeMove(this PieceEnum piece, SquareEnum square, SquareEnum moveSquare)
 => piece.IsRokadeMove(square, moveSquare) && moveSquare.File() == 6;