예제 #1
0
 public void runAway(string Location)
 {
     if (this.run != null)
     {
         RunArgs args = new RunArgs();
         args.currentLocation = Location;
         args.preLocation     = _location;
         _location            = Location;
         this.run(this, args);//激发事件只能在事件所在类的内部进行。
     }
 }
예제 #2
0
 public void Pray(Robber husband, RunArgs args)
 {
     Console.WriteLine("愿在{0}的丈夫一切安好!", husband.Location);//拉模式
 }
예제 #3
0
 public void CatchRobber(Robber robber, RunArgs args)
 {
     Console.WriteLine("抢劫犯从{0}跑到{1}了,去抓!", args.preLocation, args.currentLocation);//推模式
 }