TriggerAddCondition(t,Condition(function LLI111LLL))這里的t是一個觸發器 函數LLI111LLL不應該返回一個布爾值嗎?
3 回答

明月笑刀無情
TA貢獻1828條經驗 獲得超4個贊
這很好理解
native TriggerAddCondition takes trigger whichTrigger, boolexpr condition returns triggercondition
native Condition takes code func returns conditionfunc
type conditionfunc extends boolexpr
注意上面的
TriggerAddCondition(t,Condition(function LLI111LLL))
這個的意思是給觸發t添加環境(就是判斷部分)
傳入的參數有2個trigger whichTrigger觸發和 boolexpr condition布爾值表達式
而Condition函數是傳入code func代碼返回一個conditionfunc
而conditionfunc是一個extends繼承了boolexpr值表達式的類
所以能直接傳給TriggerAddCondition的第二個
觸發是只是一個聲明的變量 比如
local trigger t = newTrigger()
而函數才是j中的執行體 比如
function LLI111LLL takes nothing return nothing
//這里是函數體
endfunction
添加回答
舉報
0/150
提交
取消