public static void Main() { Random Rand = new Random(); Boss BB = new Boss(); int H, V = 0; int Try = 1; BB.Run += BB.EventRun; BB.Broken += BB.EventBreak; while (V < 9) { Console.WriteLine("Включить питание?"); Console.ReadKey(); Console.Clear(); Console.WriteLine($" Попытка №{Try}"); BB.TurnOn(V = Rand.Next(6, 13)); Try++; } Damage D = new Damage(); D.Check += D.Show; DELEG DamageT = D.Tech; Tech T = new Tech(H = Rand.Next(3, 6)); Console.WriteLine("Нанести случайный урон Tech->"); Console.ReadKey(); int t = DamageT(); T.GetDmg(t); Human Hum = new Human(H = Rand.Next(3, 6)); Console.WriteLine("Нанести случайный урон Tech->"); Console.ReadKey(); DELEG DamageH = D.Human; int h = DamageH(); Hum.GetDmg(h); }
private void Worker_DoWork(object sender, DoWorkEventArgs e) { Delegate del = new DELEG(AsysLoad); this.Invoke(del); }