|
发表于 2009-10-25 01:36:19
|
显示全部楼层
ExecuteBoolexpr的原型
[jass]
integer SYS_BoolexprInt
boolean SYS_BoolexprResult = false
rect SYS_Rect_ForBoolexpr
//========BaseFuncStart=======================================================
function Print takes string s returns nothing
   call DisplayTimedTextFromPlayer(GetLocalPlayer(),0,0,0,s)
endfunction
function SetBoolexprResult takes nothing returns nothing
    set SYS_BoolexprResult = true
endfunction
function ExecuteBoolexpr takes boolexpr be returns boolean
    set SYS_BoolexprResult = false
    call EnumDestructablesInRect(SYS_Rect_ForBoolexpr,be,function SetBoolexprResult)
    return SYS_BoolexprResult
endfunction
function DestructablesConfig takes nothing returns nothing
    //call Print("find")
    call RemoveDestructable(GetFilterDestructable())
endfunction
function InitBoolexprSystem takes integer dId returns nothing
    local rect r = GetWorldBounds()
    local boolexpr be = Condition(function DestructablesConfig)
    local destructable dst
    local real x = GetRectMinX(r)+50.0
    local real y = GetRectMinY(r)+50.0
    set SYS_Rect_ForBoolexpr = Rect(x,y,x+150.0,y+150.0)
    call EnumDestructablesInRect(SYS_Rect_ForBoolexpr,be,null)
    set dst = CreateDestructable(dId,GetRectCenterX(SYS_Rect_ForBoolexpr),GetRectCenterY(SYS_Rect_ForBoolexpr),0,0,0)
    call SetDestructableInvulnerable(dst,true)
    call DestroyBoolExpr(be)
    set be = null
    set r = null
endfunction[/jass] |
|