JASS:
library Unit
globals
private group grp=null
endglobals
public function filter1 takes unit u, integer ID returns boolean
return GetUnitTypeId(u)==ID
endfunction
public function CountNUnitsInGroup takes player p, integer unitID returns integer
local unit FoG=null
local integer i=0
call GroupEnumUnitsOfPlayer(grp,p, function Unit_filter1(GetEnumUnit(),unitID))
loop
set FoG=FirstOfGroup(grp)
set i=i+1
exitwhen FoG==null
call GroupRemoveUnit(grp,FoG)
endloop
return i
endfunction
endlibrary
call GroupEnumUnitsOfPlayer(grp,p, function Unit_filter1(GetEnumUnit(),unitID))
How to make the filter1 in the booleanexpr in that GroupEnumUnitsOfPlayer work?