GroupEnumUnitsOfPlayer

Parameters
whichGroup group

The group to be modified.

whichPlayer player

The player whose units to consider for adding units.

filter boolexpr

A filter function that is run for each considered unit.

comment

Clears a group and then adds units of matching player to it.

note

In contrast to spatial GroupEnum-functions, this function enumerates units with locust.

note

Within the filter function, the considered unit can be accessed with GetFilterUnit.

note

The filter function must return true (a truthy value in Lua) in order to add the unit to the group.

note

If the filter function is null (nil in Lua), all considered units will be added to the group.

note

The units are added consecutively to the group between filter runs, not in bulk after all filter runs were processed.

note

In terms of running the filter function, units are processed in reverse order in which they were created on the map.

patch

1.00

Source
common.j
return type
nothing
Source code
native GroupEnumUnitsOfPlayer               takes group whichGroup, player whichPlayer, boolexpr filter returns nothing