コード例 #1
0
ファイル: Character.cs プロジェクト: rdwoodring/mudadventure
        protected void OnAttackedAndDodge(AttackedAndDodgeEventArgs e)
        {
            EventHandler<AttackedAndDodgeEventArgs> handler = this.AttackedAndDodge;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: rdwoodring/mudadventure
 private void HandleAttackedAndDodge(object sender, AttackedAndDodgeEventArgs e)
 {
     if (e.X == this.x && e.Y == this.y && e.Z == this.z)
     {
         if (e.AttackerName == this.name)
         {
             this.writeToClient(e.DefenderName + " dodges your attack.\r\n");
         }
         else
         {
             this.writeToClient(e.DefenderName + " dodges " + e.AttackerName + "'s attack.\r\n");
         }
     }
 }