UnitGroupUnit
unit UnitGroupUnit(unitgroup g, int index)
nth unit from the unit group.
Parameters
- unitgroup g
The group.
- int index
nth unit of the group. Starting at 1.
Return value
unit -
- 1 - Count: nth unit of the group.
- 0 or out of bounds: null
Examples
- Example: UnitGroupCopy2
unitgroup UnitGroupCopy2(unitgroup old_group) { unitgroup new_group; int count; // Fill this group with the units of the group u count = UnitGroupCount(old_group, c_unitCountAll); while (count > 0) { UnitGroupAdd(new_group, UnitGroupUnit(old_group, count)); count -= 1; } return new_group; }