VEmotion.cpp文件
#include "VEmotion.h"
VEmotion::VEmotion()
{
Relation=STRINGER;
Rejection=0;
cout<<"========================================"<<endl;
cout<<"==========|欢迎来到虚拟感情世界|========"<<endl;
cout<<"========================================"<<endl<<endl;
}
int VEmotion::event(AMsg pMsg)
{
switch(Relation)
{
case STRINGER;
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***彼此熟悉了。***"<<endl<<endl;
Relation=KNOWN;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case KNOWN;
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***我们成为朋友了。***"<<endl<<endl;
Relation=FRIEND;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case FRIEND
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***我们相爱了。***"<<endl<<endl;
Relation=LOVER;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case LOVER
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***我们结婚了。***"<<endl<<endl;
Relation=COUPLE;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case CUOPLE
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***离婚吧。***"<<endl<<endl;
Relation=BYEBYE;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
{
cout<<endl<<"***不答应离婚,依然生活在一起***"<<endl<<endl;
}
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
}
return 0;
}
VEmotion::~VEmotion()
{
}
#include "VEmotion.h"
VEmotion::VEmotion()
{
Relation=STRINGER;
Rejection=0;
cout<<"========================================"<<endl;
cout<<"==========|欢迎来到虚拟感情世界|========"<<endl;
cout<<"========================================"<<endl<<endl;
}
int VEmotion::event(AMsg pMsg)
{
switch(Relation)
{
case STRINGER;
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***彼此熟悉了。***"<<endl<<endl;
Relation=KNOWN;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case KNOWN;
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***我们成为朋友了。***"<<endl<<endl;
Relation=FRIEND;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case FRIEND
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***我们相爱了。***"<<endl<<endl;
Relation=LOVER;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case LOVER
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***我们结婚了。***"<<endl<<endl;
Relation=COUPLE;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
Rejetion++;
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
case CUOPLE
if(strcmp(pMsg,"Y")==0||strcmp(pMsg,"y")==0)
{
cout<<endl<<"***离婚吧。***"<<endl<<endl;
Relation=BYEBYE;
}
else if(strcmp(pMsg,"N")==0||strcmp(pMsg,"n")==0)
{
cout<<endl<<"***不答应离婚,依然生活在一起***"<<endl<<endl;
}
else
{
strcpy(pMsg,"Y");
event(pMsg);
}
break;
}
return 0;
}
VEmotion::~VEmotion()
{
}