public void iscrtaj(Graphics g) { Random rnd = new Random(); for (int i = 5; i <= this.Width - 30; i += 35) { for (int j = 0; j <= 150; j += 21) { if (rnd.Next(10) < 6) { Color boja = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); Brush b = new SolidBrush(boja); Rectangle r = new Rectangle(i, j, 30, 20); Cigla c = new Cigla(r, b); cigli.lstCigli.Add(c); pomosna.lstCigli.Add(c); } } } }
public void iscrtaj(Graphics g) { Random rnd = new Random(); for (int i = 5; i <= this.Width-30; i += 35) { for (int j = 0; j <= 150; j += 21) { if (rnd.Next(10) < 6) { Color boja = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); Brush b = new SolidBrush(boja); Rectangle r = new Rectangle(i, j, 30, 20); Cigla c = new Cigla(r, b); cigli.lstCigli.Add(c); pomosna.lstCigli.Add(c); } } } }
public void brisi(Cigla c) { lstCigli.Remove(c); }