UnitGroupCount
void UnitGroupAdd(unitgroup g, unit u)
Add the unit to the unit group.
Parameters
- unitgroup g
The group to receive the unit.
- int mode
- null: Do nothing
- A unit: Add the unit to the group
Examples
- Example #1: Empty Group
// Create an empty group unitgroup UnitGroupEmpty() { return UnitGroup(null, -1, RegionCircle(null, 0), null, 0); }
- Example #2: Recode Unit Group Copy
unitgroup UnitGroupCopy(unitgroup old_group) { unitgroup new_group = UnitGroupEmpty(); int count = UnitGroupCount(old_group, c_unitCountAll); while (count > 0) { UnitGroupAdd(new_group, UnitGroupUnit(old_group, count)); count -= 1; } return new_group; }