DesignPattern/18.MediatorPattern/2.Code/Landlord.cpp

29 lines
623 B
C++
Raw Normal View History

2019-11-03 23:46:24 +00:00
#include "Colleague.h"
#include "Mediator.h"
Landlord::Landlord(){
name = "none";
price = 0;
address = "none";
phoneNumber = "none";
setPersonType(NONE_PERSON);
}
Landlord::Landlord(string iName, int iPrice,
string iAddress, string iPhoneNum){
name = iName;
price = iPrice;
address = iAddress;
phoneNumber = iPhoneNum;
setPersonType(LANDLORD);
}
void Landlord::answer(){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s, <20><><EFBFBD>⣺%d, <20><>ַ<EFBFBD><D6B7>%s, <20><>ϵ<EFBFBD><EFBFBD><E7BBB0>%s\n",
name.c_str(), price, address.c_str(), phoneNumber.c_str());
}
void Landlord::ask(){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s<><EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>\n",name.c_str());
(this->getMediator())->operation(this);
}