Exemple #1
0
        protected PMFinding[] GetPmFindings(Cell cell, int pmMask, PMRole pmRole)
        {
            PMFinding[] returnValue = (cell.PMSignature & pmMask).ListOfBits()
                                      .Select(pm => new PMFinding(pm, pmRole))
                                      .ToArray();

            return(returnValue);
        }
Exemple #2
0
        private void AddSolutionAction(Cell cell, int mask, PMRole maskRole, PMRole nextRole)
        {
            int otherMask = cell.PMSignature ^ mask;

            Solution.AddAction(cell, CellRole.Pattern,
                               GetPmFindings(cell,
                                             new int[] { mask, otherMask },
                                             new PMRole[] { maskRole, nextRole }));
        }
Exemple #3
0
        public PMFinding(int value, PMRole role)
        {
            if (value < 1 || value > 9)
            {
                throw new InvalidOperationException("The value must be between 1 and 9.");
            }

            Value = value;
            Role  = role;
        }