private bool DiagonalMovementIsSatisfied(PieceMovement candidate)
        {
            int fileModifier = PositionComparer.FileDistance(candidate.To, candidate.From) < 0 ? -1 : 1;
            int rankModifier = PositionComparer.RankDistance(candidate.To, candidate.From) < 0 ? -1 : 1;
            int fileIdx      = candidate.From.FileIndex + fileModifier;
            int rankIdx      = candidate.From.RankIndex + rankModifier;

            Func <bool> fileHasNext = () => fileIdx > 0 ? fileIdx <candidate.To.FileIndex
                                                                   : fileIdx> candidate.To.FileIndex;
            Func <bool> rankHasNext = () => rankIdx > 0 ? rankIdx <candidate.To.RankIndex
                                                                   : rankIdx> candidate.To.RankIndex;

            while (fileHasNext() || rankHasNext())
            {
                Position pos = Position.Create(fileIdx, rankIdx);
                if (!_board.GetSquare(pos.Id).IsEmpty)
                {
                    return(true);
                }

                fileIdx += fileModifier;
                rankIdx += rankModifier;
            }

            return(false);
        }
        public bool IsSatisfied(PieceMovement input)
        {
            if (PositionComparer.FileDistanceAbs(input.From, input.To) == 0)
            {
                int rankDistance = PositionComparer.RankDistance(input.From, input.To);

                if (input.Piece.Color == PieceColor.White &&
                    rankDistance < 0 && rankDistance >= (input.Piece.HasMoved ? -1 : -2))
                {
                    return(true);
                }

                if (input.Piece.Color == PieceColor.Black &&
                    rankDistance > 0 && rankDistance <= (input.Piece.HasMoved ? 1 : 2))
                {
                    return(true);
                }
            }
            else if (PositionComparer.FileDistanceAbs(input.From, input.To) == 1 &&
                     PositionComparer.RankDistanceAbs(input.From, input.To) == 1)
            {
                Square squareDestination = _board.GetSquare(input.To.Id);
                if (!squareDestination.IsEmpty && squareDestination.Piece.Color != input.Piece.Color)
                {
                    return(true);
                }
            }

            return(false);
        }