protected PMFinding[] GetPmFindings(Cell cell, int pmMask, PMRole pmRole) { PMFinding[] returnValue = (cell.PMSignature & pmMask).ListOfBits() .Select(pm => new PMFinding(pm, pmRole)) .ToArray(); return(returnValue); }
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 })); }
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; }