Beispiel #1
0
        private static SudokuNumber Rotate(SudokuNumber a_number, SudokuBoard a_board)
        {
            int col_r = a_number.Col;
            int row_r = a_number.Row;

            Rotate(ref col_r, ref row_r);

            return(a_board[col_r, row_r][a_number.Number - 1]);
        }
Beispiel #2
0
        internal void OnCellChanged(SudokuNumber a_number)
        {
            m_bSolved   = null;
            m_bSolvable = null;

            if (BoardChanged != null)
            {
                BoardChanged(a_number);
            }
        }
Beispiel #3
0
        internal SudokuCell(SudokuBoard a_board, int a_col, int a_row)
        {
            m_board = a_board;

            m_numbers = new SudokuNumber[SudokuBoard.SIZE];

            m_row   = a_row;
            m_col   = a_col;
            m_index = a_row * SudokuBoard.SIZE + a_col;
            m_box   = new Point(m_col / SudokuBoard.BOX_SIZE, m_row / SudokuBoard.BOX_SIZE);

            for (int i = 1; i <= SudokuBoard.SIZE; i++)
            {
                m_numbers[i - 1] = new SudokuNumber(this, i);
            }
        }
Beispiel #4
0
        public override bool Equals(object a_obj)
        {
            if (a_obj == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, a_obj))
            {
                return(true);
            }
            SudokuNumber num = a_obj as SudokuNumber;

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

            return((m_state == num.State) &&
                   (num.Index == Index) &&
                   (m_number == num.Number));
        }
Beispiel #5
0
        internal void CopyFrom(SudokuNumber a_number)
        {
            m_state = a_number.State;

            m_cell.OnNumberChanged(null);
        }
Beispiel #6
0
 internal void OnNumberChanged(SudokuNumber a_number)
 {
     Board.OnCellChanged(a_number);
 }