/* * Raises the event "DefenceBeginning", if an subscription for it exists. */ private void Hero_DefenceBeginning(object sender, DefenceBeginningArgs e) { if (DefenceBeginning != null) { new EventHandler <DefenceBeginningArgs>(DefenceBeginning) (this, e); } }
/* * When the "DefenceBeginning" event is being raised, * prints in the console the actual damage received from the defending hero. */ private static void GameEngine_DefenceBeginning(object sender, DefenceBeginningArgs e) { Console.WriteLine(e.Defender.Nickname + " recieved " + e.ActualDamage + " points of actual damage."); }