Esempio n. 1
0
        private void RegisterCellWithSection(SectionCollection sectionCollection, FieldSectionType sectionType, SudokuCell cell)
        {
            RegistrationKey sectionKey = null;

            switch (sectionType)
            {
            case FieldSectionType.Row:
                sectionKey = CreateRowKey(cell);
                break;

            case FieldSectionType.Column:
                sectionKey = CreateColumnKey(cell);
                break;

            case FieldSectionType.Block:
                sectionKey = CreateBlockKey(cell);
                break;

            default:
                throw new Exception("No fieldtype is set");
            }

            //retrieve the section from the collection
            SilverSudokuSection theSection = sectionCollection.GetSectionByKey(sectionKey);

            if (theSection == null)
            {   //the section doesn't exist: create it and add it to the collection
                theSection             = new SilverSudokuSection(NumColumns, sectionKey);
                theSection.SectionType = sectionType;
                sectionCollection.Add(theSection);
            }
            theSection.RegisterCell(cell);
            cell.Parents.Add(theSection);
        }
Esempio n. 2
0
 public void SetFieldSection(FieldSectionType type)
 {
     GameDebug.Assert(m_FieldMask == 0, "Field masks cannot be combined.");
     if (type == FieldSectionType.OnlyNotPredicting)
     {
         m_FieldMask = 0x1;
     }
     else
     {
         m_FieldMask = 0x2;
     }
 }
Esempio n. 3
0
        public SectionCollection(FieldSectionType sectionCollectionType)
        {
//            _sectionCollectionType = sectionCollectionType;
        }