ForGroup
native ForGroup takes [[[group|group.html]]] whichGroup, [[[code|code.html]]] callback returns [[[nothing|nothing.html]]]
Применяет функцию для каждого юнита в группе.
globals
group g = [[[CreateGroup|creategroup.html]]]()
endglobals
function forGroupIterator takes [[[nothing|nothing.html]]] returns [[[nothing|nothing.html]]]
call ConsolePrint(GetUnitName([[[GetEnumUnit|getenumunit.html]]]()))
endfunction
function gameStart takes [[[nothing|nothing.html]]] returns [[[nothing|nothing.html]]]
call ForGroup([[[null|null.html]]], [[[null|null.html]]]) // Безопасна при работе с [[[null|null.html]]]
call GroupAddUnit(g, CreateUnit(Player(0), '[[[uloc|aloc.html]]]', 0, 0, 0))
call GroupAddUnit(g, CreateUnit(Player(0), 'hfoo', 0, 0, 0))
call ForGroup(g, function forGroupIterator)
endfunction
function [[[main|main.html]]] takes [[[nothing|nothing.html]]] returns [[[nothing|nothing.html]]]
call TimerStart(CreateTimer(), 0, false, function gameStart)
endfunction
Last modified: 22 October 2024