Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
       Fungus f1 = new Fungus(new Point(rand.Next(canvas.ScaledWidth), rand.Next(canvas.ScaledHeight)), canvas, EColor.Red);
       Fungus f2 = new Fungus(new Point(rand.Next(canvas.ScaledWidth), rand.Next(canvas.ScaledHeight)), canvas, EColor.Blue);
       Fungus f3 = new Fungus(new Point(rand.Next(canvas.ScaledWidth), rand.Next(canvas.ScaledHeight)), canvas, EColor.Green);
       Fungus[] fungi = { f1, f2, f3 };
       foreach (Fungus f in fungi)
       {
     f.spore();
       }
 }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            Fungus f1 = new Fungus(new Point(rand.Next(canvas.ScaledWidth), rand.Next(canvas.ScaledHeight)), canvas, EColor.Red);
            Fungus f2 = new Fungus(new Point(rand.Next(canvas.ScaledWidth), rand.Next(canvas.ScaledHeight)), canvas, EColor.Blue);
            Fungus f3 = new Fungus(new Point(rand.Next(canvas.ScaledWidth), rand.Next(canvas.ScaledHeight)), canvas, EColor.Green);

            Fungus[] fungi = { f1, f2, f3 };
            foreach (Fungus f in fungi)
            {
                f.spore();
            }
        }