protected void OnAttackedAndHit(AttackedAndHitEventArgs e) { EventHandler<AttackedAndHitEventArgs> handler = this.AttackedAndHit; if (handler != null) { handler(this, e); } }
private void HandleAttackedAndHit(object sender, AttackedAndHitEventArgs e) { if (e.X == this.x && e.Y == this.y && e.Z == this.z) { if (e.AttackerName == this.name) { this.writeToClient("You hit " + e.DefenderName + ", doing some damage.\r\n\r\n"); } else { this.writeToClient(e.AttackerName + " hits " + e.DefenderName + ", doing some damage.\r\n\r\n"); } } }