public override bool Equals(object a_obj)
        {
            if (a_obj == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, a_obj))
            {
                return(true);
            }
            SudokuSolutionColorUnits units = a_obj as SudokuSolutionColorUnits;

            if (units == null)
            {
                return(false);
            }

            return(m_units.ContainsExact(units.m_units, SudokuCellsListComparer.Instance));
        }
예제 #2
0
        public SudokuSolution(SudokuSolutionType a_type, IEnumerable <SudokuNumber> a_removed, IEnumerable <SudokuNumber> a_stayed,
                              IEnumerable <SudokuNumber> a_solved, IEnumerable <IEnumerable <SudokuCell> > a_cellColors)
        {
            m_type = a_type;

            if (a_removed != null)
            {
                m_removed = a_removed.Distinct().OrderBy(num => num.Index).ToList();
            }
            else
            {
                m_removed = new List <SudokuNumber>();
            }

            if (a_stayed != null)
            {
                m_stayed = a_stayed.Distinct().OrderBy(num => num.Index).ToList();
            }
            else
            {
                m_stayed = new List <SudokuNumber>();
            }

            if (a_solved != null)
            {
                m_solved = a_solved.Distinct().OrderBy(num => num.Index).ToList();
            }
            else
            {
                m_solved = new List <SudokuNumber>();
            }

            if (a_cellColors != null)
            {
                m_colorUnits = new SudokuSolutionColorUnits(a_cellColors);
            }
            else
            {
                m_colorUnits = new SudokuSolutionColorUnits();
            }
        }