Ejemplo n.º 1
0
 /*
  * Raises the event "HeroIsDead", if an subscription for it exists.
  */
 private void Hero_IsDead(object sender, HeroIsDeadArgs e)
 {
     if (HeroIsDead != null)
     {
         new EventHandler <HeroIsDeadArgs>(HeroIsDead)
             (this, e);
     }
 }
Ejemplo n.º 2
0
 /*
  * When the "HeroIsDead" event is being raised,
  * prints in the console the nickname of the hero who died.
  */
 private static void GameEngine_HeroIsDead(object sender, HeroIsDeadArgs e)
 {
     Console.WriteLine();
     Console.WriteLine(e.DeadHero.Nickname + " is now dead.");
 }