Re: [wizs]問題請教(十)
看板mud_sanc (Sanctuary - 聖殿)作者airkiss (空中之吻)時間18年前 (2007/07/04 01:44)推噓1(1推 0噓 0→)留言1則, 1人參與討論串2/3 (看更多)
※ 引述《amosdeus (幽素)》之銘言:
: 為了保密以x來代替
: 我想請教問題有兩個
: 第一、請問要怎樣為同在一個房間的所有玩家,在技能上加的數值
二種作法 :
1. gobal search method (耗資源, 通常用於全域search)
object room = this_object();
object * alluser = users();
foreach (object ppl in alluser) {
// user in the room and online
if (environment(ppl) == room && interactive(ppl)) {
// do something
}
}
2. room based method (比較一般用法)
object room = this_object();
object * allitem = all_inventory(room);
foreach (object item in allitem) {
// user in the room and online
if(userp(item) && interactive(item)) {
// do something
}
}
: 第二、請問要增加技能數值是用add嗎?
Assume the skill name is abcde :
ppl->add("skill/abcde",num);
Airkiss
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.194.0.240
※ 編輯: airkiss 來自: 203.187.0.206 (07/04 11:32)
推
07/04 17:54, , 1F
07/04 17:54, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 3 篇):
mud_sanc 近期熱門文章
PTT遊戲區 即時熱門文章