Beispiel #1
0
 public void Action(object obj, FireEventArgs e)
 {
     Console.WriteLine("由于" + ((Person)obj).Name + "开枪," + e.Animal.Name + "受到了惊吓。"); if (e.Animal.Name == "鸟")
     {
         Console.WriteLine(e.Animal.Name + "飞了");
     }
 }
Beispiel #2
0
 public void OnFire(FireEventArgs e)
 {
     Console.WriteLine($"{Name}正在开枪");
     if (FirEventHandler != null)
     {
         FirEventHandler.Invoke(this, e);
     }
 }