示例#1
0
文件: King.cs 项目: jmarkova/ITCareer
 public void UnderAttack(EventArgs e)
 {
     Helper.WriteLine($"King {this.name} is under attack!");
     try
     {
         OnUnderAttack(this, e);
     }
     catch {;; }
 }
示例#2
0
 // event
 public void KingIsUnderAttack(object sender, EventArgs e)
 {
     this.life--;
     Helper.WriteLine($"Footman {this.Name} is panicking!");
 }
示例#3
0
 // event
 public void KingIsUnderAttack(object sender, EventArgs e)
 {
     this.life--;
     Helper.WriteLine($"Royal Guard {this.Name} is defending!");
 }