public override bool IsSpecialMove(Square origin, Square destination)
        {
            if (origin.Color == GetEnPassantSquare(origin, destination).Color) return false;

            var occupierOfEnPassantPosition = GetEnPassantSquare(origin, destination).Occupier;

            return (origin.DiagonallyForwardTo(destination)
                    && origin.DistanceOfRanksIsOneTo(destination)
                    && destination.Color == PieceColor.Empty
                    && occupierOfEnPassantPosition.MoveCount == 1);
        }
Exemple #2
0
 private bool Attacking(Square origin, Square destination)
 {
     return (origin.Color != destination.Color
             && destination.Color != PieceColor.Empty
             && origin.DistanceOfRanksIsOneTo(destination)
             && origin.DiagonallyForwardTo(destination));
 }