private bool showPossibleMoves; // вкл выкл этот режим public Doska(PictureBox pictureBox1, Label lb, Color cl1, Color cl2) // конструктор { this.field = pictureBox1; this.label = lb; ColorOfFirstPlayer = cl1; ColorOfSecondPlayer = cl2; var bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height); Graphics g = Graphics.FromImage(bmp); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; // сглаживание for (int i = 0; i < 30; i++) { if (i < 15) { myFishka[i] = new Fishka(i); myFishka[i] = new Fishka(cl1, 0, i); myTable[0, i + 1] = i; myTable[0, 0] += 1; } else { myFishka[i] = new Fishka(cl2, 12, i - 14); myTable[12, i - 14] = i; myTable[12, 0] += 1; } } foreach (var fishka in myFishka) { fishka.Draw(g); } pictureBox1.Image = bmp; g.Dispose(); } // end constructor
} // end constructor //!!!!!!!!test mode public Doska(PictureBox pictureBox1, Label lb, Color cl1, Color cl2, int k) { this.field = pictureBox1; this.label = lb; ColorOfFirstPlayer = cl1; ColorOfSecondPlayer = cl2; var bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height); Graphics g = Graphics.FromImage(bmp); for (int i = 0; i < 30; i++) { if (i < 15) // положение 19 { myFishka[i] = new Fishka(i); myFishka[i] = new Fishka(cl1, 19, i); myTable[19, i + 1] = i; myTable[19, 0] += 1; } else // положение 6 { myFishka[i] = new Fishka(cl2, 6, i - 14); myTable[6, i - 14] = i; myTable[6, 0] += 1; } } foreach (var fishka in myFishka) { fishka.Draw(g); } pictureBox1.Image = bmp; g.Dispose(); }