• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Condition() vs Filter()

Status
Not open for further replies.
Level 8
Joined
Jul 10, 2008
Messages
353
Condition() vs Filter()

What is their difference?

JASS:
native Filter           takes code func returns filterfunc
native Condition        takes code func returns conditionfunc

type filterfunc         extends     boolexpr
type conditionfunc      extends     boolexpr
filterfunc, conditionfunc both just extend boolexpr

Also does -> boolexpr , leak?
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
Filter and Condition are the same.
JASS:
scope foo initializer init

private function B2S takes boolean b returns string
    if b then
        return "true"
    else
        return "false"
    endif
endfunction

private function init takes nothing returns nothing
    call BJDebugMsg(B2S(Or(function init, function init) == Or(function init, function init)))
    call BJDebugMsg(B2S(Filter(function init) == Filter(function init)))
endfunction

endscope
This prints false,true.
So, destroy boolexprs created by And,Or,Not and don't destroy the ones created by Filter,Condition
 
Level 8
Joined
Jul 10, 2008
Messages
353
@LeP

Even if the Condition() or Filter() was created for a temporal trigger? Or for functions like GroupEnumUnitsInRect(g, r, Filter()) ?
 
Status
Not open for further replies.
Top