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

21 lines
361 B
C++
Raw Normal View History

2019-11-03 23:46:24 +00:00
#include "Colleague.h"
#include "Mediator.h"
Tenant::Tenant(){
name = "none";
setPersonType(NONE_PERSON);
}
Tenant::Tenant(string iName){
name = iName;
setPersonType(TENANT);
}
void Tenant::ask(){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%sѯ<73>ʷ<EFBFBD><CAB7><EFBFBD><EFBFBD><EFBFBD>Ϣ\n", name.c_str());
(this->getMediator())->operation(this);
}
void Tenant::answer(){
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n", name.c_str());
}