Example #1
0
 public override void Communication(string msg, Person person)
 {
     //如果是房东则通知租客
     if (person is Landlord)
     {
         Tenant.ReceiveNotify(msg);
     }
     else //如果是租客则通知房东
     {
         Landlord.ReceiveNotify(msg);
     }
 }
Example #2
0
 /// <summary>
 /// 代替某人发起一个消息
 /// </summary>
 /// <param name="msg">消息</param>
 /// <param name="person">消息发起者</param>
 public abstract void Communication(string msg, Person person);