- Joined
- Feb 6, 2014
- Messages
- 2,466
Hello hivers,
Which do you think is better? For me it looks option B is better but I want to be sure. Also, I haven't tested yet if option B will work.
OPTION A: I create, assign new members and destroy group afterwards everytime
[jass=Option A]
function ...
local group g = CreateGroup()
call GroupEnumUnitsInRange(g, x, y, 200, null)
loop
//Some actions here
endloop
call DestroyGroup(g)
endfunction
[/code]
OPTION B: I emptied the global group and assign new members everytime I use it
[jass=Option B]
globals
private group g = CreateGroup()
endglobals
function ...
call GroupClear(g)
call GroupEnumUnitsInRange(g, x, y, 200, null)
loop
//Some actions here
endloop
endfunction
[/code]
Which do you think is better? For me it looks option B is better but I want to be sure. Also, I haven't tested yet if option B will work.
OPTION A: I create, assign new members and destroy group afterwards everytime
[jass=Option A]
function ...
local group g = CreateGroup()
call GroupEnumUnitsInRange(g, x, y, 200, null)
loop
//Some actions here
endloop
call DestroyGroup(g)
endfunction
[/code]
OPTION B: I emptied the global group and assign new members everytime I use it
[jass=Option B]
globals
private group g = CreateGroup()
endglobals
function ...
call GroupClear(g)
call GroupEnumUnitsInRange(g, x, y, 200, null)
loop
//Some actions here
endloop
endfunction
[/code]