本文整理汇总了C++中mixed::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ mixed::GetName方法的具体用法?C++ mixed::GetName怎么用?C++ mixed::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mixed
的用法示例。
在下文中一共展示了mixed::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MarriageRequest
int MarriageRequest(mixed arg1, mixed arg2, mixed arg3){
string s1, s2, dudename;
object ob1, ob2;
if(strsrch(arg2,"divorce") != -1){
this_object()->performDivorce(arg1);
return 1;
}
if(sscanf(arg3,"%s and %s", s1, s2) !=2 &&
sscanf(arg3,"%s to %s", s1, s2) !=2){
eventForce("say "+arg1->GetName()+", you are confusing me.");
return 1;
}
dudename = arg1->GetKeyName();
if(s1 == "me" || s1 == "i") s1 = dudename;
if(s2 == "me" || s2 == "i") s2 = dudename;
if(s1 != dudename && s2 != dudename ){
eventForce("say Those people will have to decide "+
"to get married on their own. It isn't "+
"any of your business.");
return 1;
}
if( s1 == s2){
eventForce("say we don't do single-member marriages here.");
return 1;
}
if(! ob1 = present(s1, environment(this_object()))){
eventForce("say "+capitalize(s1)+" isn't here.");
return 1;
}
if(! ob2 = present(s2, environment(this_object()))){
eventForce("say "+capitalize(s2)+" isn't here.");
return 1;
}
if(!living(ob1) || !living(ob2)){
eventForce("say I do not perform marriages with inanimate objects.");
return 1;
}
this_object()->performMarriage(ob1, ob2);
return 1;
}