/* * Raises the event "AttackBeginning", if an subscription for it exists. */ private void Hero_AttackBeginning(object sender, AttackBeginningArgs e) { if (AttackBeginning != null) { new EventHandler <AttackBeginningArgs>(AttackBeginning) (this, e); } }
/* * When the "AttackBeginning" event is being raised, * prints in the console the pure damage unleashed from the attacking hero. */ private static void GameEngine_AttackBeginning(object sender, AttackBeginningArgs e) { Console.WriteLine(e.Attacker.Nickname + " unleashed " + e.RawDamage + " points of pure damage."); }