本文整理汇总了C++中mixed::query_name方法的典型用法代码示例。如果您正苦于以下问题:C++ mixed::query_name方法的具体用法?C++ mixed::query_name怎么用?C++ mixed::query_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mixed
的用法示例。
在下文中一共展示了mixed::query_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: send_beep
void send_beep(object o_user, mixed t_user, string t_mud)
{
if(objectp(t_user)) t_user = lower_case(t_user->query_name());
else
if(stringp(t_user)) t_user = lower_case(t_user);
else return;
find_object(I3_CHDMOD)->sendToUser("beep", o_user->query_name(), t_mud, t_user, 0);
}
示例2: query_mortal
nomask int query_mortal(mixed player) {
if (objectp(player)) {
if (!player <-"/sys/obj/player") {
return 0;
}
player = player->query_name();
} else {
argcheck(stringp(player), 1, "player object or string");
}
return !query_wizard(player);
}
示例3: query_admin
int query_admin(mixed player) {
if(objectp(player)) {
if( !player<-"/sys/lib/player" ) {
return 0;
}
player = player->query_name();
} else {
argcheck( stringp( player ), 1, "player object or string" );
}
return SECURE_D->query_admin( player ) ;
}
示例4: send_error
varargs void send_error(mixed o_user, string t_mud, mixed t_user, string err_code, string err_msg, mixed *packet)
{
if(intp(o_user)) o_user = 0;
else
if(objectp(o_user)) o_user = o_user->query_name();
else
if(stringp(o_user)) o_user = lower_case(o_user);
else o_user = 0;
if(intp(t_user)) t_user = 0;
else
if(objectp(t_user)) t_user = t_user->query_name();
else
if(stringp(t_user)) t_user = lower_case(t_user);
else t_user = 0;
find_object(I3_CHDMOD)->sendToUser("error", o_user, t_mud, t_user, ({
err_code,
err_msg,
packet ? packet : 0
}) );
示例5: pluralize
string pluralize(mixed single) {
int x;
string str, tmp;
if(!single) return single;
if(objectp(single)) {
if(str = (string)single->query("plural name")) return str;
else str = (string)single->query_name();
}
else str = (string)single;
if(!str) return str;
x = strlen(str);
if(ABNORMAL[str]) return ABNORMAL[str];
if(x > 2 && str[x-3..x-1] == "man")
return str[0..x-3]+"en";
if(x > 1) {
tmp = str[x-2..x-1];
switch(tmp) {
case "ts": return str+"";
case "ch": case "sh":
return str+"es";
case "ff": case "fe":
return str[0..x-3]+"ves";
case "us":
return str[0..x-3]+"i";
case "um":
return str[0..x-3]+"a";
case "ef":
return str+"s";
}
}
tmp = str[x-1..x-1];
// 2 bug fixes by Whit
if(str[sizeof(str)-2..sizeof(str)] == "ts") return str;
if(str[sizeof(str)-2..sizeof(str)] == "es") return str;
switch(tmp) {
case "s":
return str+"es";
case "o": case "x":
return str+"es";
case "wolf": return str[0..x-4]+"wolves";
case "f": return str[0..x-2]+"ves";
case "y" : return str[0..x-2]+"ies";
}
return str+"s";
}