public ISolvedSquaresResult SolveSquares(IPartiallyCompleteGroup partiallyCompleteForGroup)
        {
            var filteredCombinations = this.FilterCombinations(partiallyCompleteForGroup);

            if (filteredCombinations.Count == 0)
            {
                return new CantBeSolvedResult();
            }   

            if (filteredCombinations.Count == 1)
            {
                return new SolvedSquares.SolvedSquaresResult(filteredCombinations.First());
            }

            var partiallyComplete = new PartiallyCompleteGroup(filteredCombinations.First());

            foreach (var possibleCombination in filteredCombinations)
            {
                partiallyComplete = partiallyComplete.Merge(new PartiallyCompleteGroup(possibleCombination));
            }

            if (partiallyComplete.Equals(partiallyCompleteForGroup))
            {
                return new NothingSolvedThisRoundResult(partiallyCompleteForGroup);
            }

            return new PartiallySolvedSquaresResult(partiallyComplete);
        }
 public List<BitGroup> FilterCombinations(IPartiallyCompleteGroup partiallyCompleteForGroup)
 {
     return this.AllCombinations().Where(partiallyCompleteForGroup.GroupMatchesKnownSquares).ToList();
 }
 public NothingSolvedThisRoundResult(IPartiallyCompleteGroup partiallyCompleteForGroup)
 {
     this.partiallyCompleteForGroup = partiallyCompleteForGroup;
 }