Exemple #1
0
        /*整理组函数(绑定BlankConform事件)
         * 类函数:整理本组成员
         * 参数:标准事件函数
         * 返回值:void
         */
        public void SettleGroup(object sender, Suduku_EventArgs e)
        {
            switch (this.GrpType)
            {
            case GroupType.Row:
                this.Unsolved_Blank.Remove(this.Blank[Index_Parser.Row_index(e.ConformIndex)]);
                for (int i = 0; i < this.Unsolved_Blank.Count; i++)
                {
                    this.Unsolved_Blank[i].iValues.Remove(this.Blank[Index_Parser.Row_index(e.ConformIndex)].Value);
                }
                break;

            case GroupType.Column:
                this.Unsolved_Blank.Remove(this.Blank[Index_Parser.Column_index(e.ConformIndex)]);
                for (int i = 0; i < this.Unsolved_Blank.Count; i++)
                {
                    this.Unsolved_Blank[i].iValues.Remove(Blank[Index_Parser.Column_index(e.ConformIndex)].Value);
                }
                break;

            case GroupType.Mix:
                this.Unsolved_Blank.Remove(this.Blank[Index_Parser.Mix_index(e.ConformIndex)]);
                for (int i = 0; i < this.Unsolved_Blank.Count; i++)
                {
                    this.Unsolved_Blank[i].iValues.Remove(Blank[Index_Parser.Mix_index(e.ConformIndex)].Value);
                }
                break;
            }
        }
Exemple #2
0
        public void Resutore_Image(Suduku_Group image)
        {
            this.Unsolved_Blank.Clear();
            switch (this.GrpType)
            {
            case GroupType.Row:
                for (int i = 0; i < image.Unsolved_Blank.Count; i++)
                {
                    this.Unsolved_Blank.Add(this.Blank[Index_Parser.Row_index(image.Unsolved_Blank[i].Index)]);
                }
                break;

            case GroupType.Column:
                for (int i = 0; i < image.Unsolved_Blank.Count; i++)
                {
                    this.Unsolved_Blank.Add(this.Blank[Index_Parser.Column_index(image.Unsolved_Blank[i].Index)]);
                }
                break;

            case GroupType.Mix:
                for (int i = 0; i < image.Unsolved_Blank.Count; i++)
                {
                    this.Unsolved_Blank.Add(this.Blank[Index_Parser.Mix_index(image.Unsolved_Blank[i].Index)]);
                }
                break;
            }
        }