/* * Raises the event "DefenceEnd", if an subscription for it exists. */ private void Hero_DefenceEnd(object sender, DefenceEndArgs e) { if (DefenceEnd != null) { new EventHandler <DefenceEndArgs>(DefenceEnd) (this, e); } }
/* * When the "DefenceEnd" event is being raised, * prints in the console the health points of the hero who was attacked. */ private static void GameEngine_DefenceEnd(object sender, DefenceEndArgs e) { Console.WriteLine(e.Defender.Nickname + "'s health points: " + e.Defender.HealthPoints + "."); }