I need to pick all units within range of a spell cast that are enemies and do something to them. I was optimizing my code and came across this BJ. I need a way to make my own version but i dont quite understand the code.
What exactly is callback? And how would I make my own version of this? Thanks.
JASS:
function ForGroupBJ takes group whichGroup, code callback returns nothing
// If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
call ForGroup(whichGroup, callback)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(whichGroup)
endif
endfunction
What exactly is callback? And how would I make my own version of this? Thanks.