Example #1
0
        /// <summary>
        /// Returns true if the sectioncollection contains the key
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public bool ContainsKey(RegistrationKey key)
        {
            bool retValue = false;

            foreach (SilverSudokuSection section in sections)
            {
                if (section.Key == key)
                {
                    retValue = true;
                }
            }
            return(retValue);
        }
Example #2
0
        /// <summary>
        /// Retrieves a section by a key.
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public SilverSudokuSection GetSectionByKey(RegistrationKey key)
        {
            SilverSudokuSection retValue = null;

            foreach (SilverSudokuSection section in sections)
            {
                if (section.Key.Equals(key))
                {
                    retValue = section;
                }
            }
            return(retValue);
        }
Example #3
0
        public override bool Equals(object obj)
        {
            RegistrationKey otherKey = obj as RegistrationKey;

            if (otherKey == null)
            {
                return(false);
            }
            if (otherKey._columnIndex == this._columnIndex &&
                otherKey._rowIndex == this._rowIndex)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public SilverSudokuSection(int NumCells, RegistrationKey key)
     : this(NumCells)
 {
     _key = key;
 }
        /// <summary>
        /// Retrieves an array with the possibilities of the cell
        /// </summary>
        /// <param name="key">The key of the cell for which to retrieve the possibilities</param>
        /// <returns></returns>
        public List <int> GetPossibilities(RegistrationKey key)
        {
            SudokuCell cell = GetCellByKey(key);

            return(cell.Possibilities);
        }
Example #6
0
 public SudokuCell GetCell(RegistrationKey key)
 {
     return(speelveld[key.RowIndex, key.ColumnIndex]);
 }