Beispiel #1
0
 public void OnShoot()
 {
     if (KillingCompleted != null)
     {
         KillingCompleted.Invoke(this, EventArgs.Empty);
         Console.WriteLine("shooting.......");
     }
 }
Beispiel #2
0
 //3.Alcanzar el evento
 public void OnShoot()
 {
     if (KillingCompleted == null)
     {
         return;
     }
     KillingCompleted.Invoke(this, new ShooterEventArgs(Name, Shots));
 }
Beispiel #3
0
 public void OnShoot()
 {
     while (true)
     {
         if ((rng.Next(0, 100) % 2) == 0)
         {
             if (KillingCompleted != null)
             {
                 KillingCompleted.Invoke(this, EventArgs.Empty);
             }
         }
         else
         {
             Console.WriteLine("missed");
         }
         Thread.Sleep(500);
     }
 }