Beispiel #1
0
        public override void PaintForeground(HintPainter hp, Hint.Kind v)
        {
            PaintContext context = (PaintContext)hp;
            int          Cells   = context.grid.Cells;

            if (house == Houses.Column)
            {
                for (int y = 0; y < Cells; ++y)
                {
                    if (context.grid.FlagAt(i0, y) == SudokuGrid.CellFlags.Free)
                    {
                        context.SetPencil(i0, y, i1, v);
                    }
                }
            }
            else if (house == Houses.Row)
            {
                for (int x = 0; x < Cells; ++x)
                {
                    if (context.grid.FlagAt(x, i0) == SudokuGrid.CellFlags.Free)
                    {
                        context.SetPencil(x, i0, i1, v);
                    }
                }
            }
            else if (house == Houses.Box)
            {
                for (int x = 0; x < Cells; ++x)
                {
                    for (int y = 0; y < Cells; ++y)
                    {
                        if (context.grid.FlagAt(x, y) == SudokuGrid.CellFlags.Free &&
                            context.grid.BoxAt(x, y) == i0)
                        {
                            context.SetPencil(x, y, i1, v);
                        }
                    }
                }
            }
            else if (house == Houses.MajorDiagonal)
            {
                for (int x = 0; x < Cells; ++x)
                {
                    if (context.grid.FlagAt(x, x) == SudokuGrid.CellFlags.Free)
                    {
                        context.SetPencil(x, x, i0, v);
                    }
                }
            }
            else if (house == Houses.MinorDiagonal)
            {
                for (int x = 0; x < Cells; ++x)
                {
                    if (context.grid.FlagAt(x, Cells - x - 1) == SudokuGrid.CellFlags.Free)
                    {
                        context.SetPencil(x, Cells - x - 1, i0, v);
                    }
                }
            }
        }
Beispiel #2
0
        public override void PaintBackground(HintPainter hp, Hint.Kind v)
        {
            PaintContext context = (PaintContext)hp;
            int          Cells   = context.grid.Cells;
            Brush        back    = PaintContext.BackgroundBrush(v);

            if (house == Houses.Cell)
            {
                context.FillCell(i0, i1, back);
            }
            else if (house == Houses.Column)
            {
                context.FillColumn(i0, back);
            }
            else if (house == Houses.Row)
            {
                context.FillRow(i0, back);
            }
            else if (house == Houses.Box)
            {
                context.FillBox(i0, back);
            }
            else if (house == Houses.MajorDiagonal)
            {
                for (int x = 0; x < Cells; ++x)
                {
                    context.FillCell(x, x, back);
                }
            }
            else if (house == Houses.MinorDiagonal)
            {
                for (int x = 0; x < Cells; ++x)
                {
                    context.FillCell(x, Cells - x - 1, back);
                }
            }
        }
Beispiel #3
0
 public virtual void PaintForeground(HintPainter context)
 {
 }
Beispiel #4
0
 public virtual void PaintBackground(HintPainter context)
 {
 }
Beispiel #5
0
 public override void PaintForeground(HintPainter context)
 {
     Candidate.PaintForeground(context, Hint.Kind.AmongMust);
 }
Beispiel #6
0
 public override void PaintForeground(HintPainter context)
 {
     Candidate.PaintForeground(context, 0);
 }
Beispiel #7
0
 public override void PaintBackground(HintPainter context)
 {
     Requirement.PaintBackground(context, Hint.Kind.AmongMust);
     Candidate.PaintBackground(context, Hint.Kind.Must);
 }
Beispiel #8
0
 public override void PaintForeground(HintPainter context)
 {
     c.PaintForeground(context, 0);
 }
        public override void PaintBackground(HintPainter hp, Hint.Kind v)
        {
            PaintContext context = (PaintContext)hp;

            context.FillCell(x, y, v);
        }
        public override void PaintForeground(HintPainter hp, Hint.Kind v)
        {
            PaintContext context = (PaintContext)hp;

            context.SetPencil(this, v);
        }
Beispiel #11
0
 public virtual void PaintBackground(HintPainter context, Hint.Kind v)
 {
 }