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); }
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; } }
public SectionCollection(FieldSectionType sectionCollectionType) { // _sectionCollectionType = sectionCollectionType; }