Example #1
0
        /// <summary>
        /// Отрисовать стертые клетки
        /// </summary>
        public static void DrawCells(Panel panel)
        {
            Graphics graphics = panel.CreateGraphics();
            Color    color;
            Pen      pen;
            Brush    brush;

            for (int i = 0; i < COLUMNS_COUNT; i++)
            {
                for (int j = 0; j < ROWS_COUNT; j++)
                {
                    if (Field.cellStates[i, j] == CellStates.Figure)
                    {
                        color = Field.GetCellCOlor(i, j);
                        pen   = new Pen(color);
                        brush = pen.Brush;

                        graphics.FillRectangle(brush, i * CELL_SIZE + 1, j * CELL_SIZE + 1, CELL_SIZE - 1, CELL_SIZE - 1);
                        graphics.DrawRectangle(blackPen, i * CELL_SIZE, j * CELL_SIZE, CELL_SIZE, CELL_SIZE);
                    }
                }
            }
        }