Ejemplo n.º 1
0
        public override bool Equals(object a_obj)
        {
            if (a_obj == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, a_obj))
            {
                return(true);
            }
            SudokuSolutionNode node = a_obj as SudokuSolutionNode;

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

            if (m_state != node.m_state)
            {
                return(false);
            }

            if (!m_board.Equals(node.m_board))
            {
                return(false);
            }

            if ((m_solution == null) && (node.m_solution == null))
            {
                return(true);
            }

            if ((m_solution == null) ^ (node.m_solution == null))
            {
                return(false);
            }

            if (m_solution.Equals(node.m_solution))
            {
                return(true);
            }

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

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

            return(m_before.Equals(intermediate_solution.m_before) &&
                   m_after.Equals(intermediate_solution.m_after) &&
                   m_solution.Equals(intermediate_solution.m_solution));
        }