Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Retrieve a list of objects in a group... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var list = enumGroup(group); |
Parameters
Parameter | Type | Mandatory | Notes | Game version |
---|---|---|---|---|
group | Number | The numeric ID of the group. | 3.1 Beta 1 |
Return values
Value | Type | Notes | Game version |
---|---|---|---|
<list> | Array of Droid objects | In Warzone 3.1, groups could only contain droid objects belonging to you. | 3.1 branch |
<list> | Array of Game objects | In Warzone 3.2 and above, groups can contain any type of game object owned by any player. | 3.2 |
[ ] | Empty Array | If there's nothing in the group, an |
...
empty array is returned. | 3.1 Beta 1 | ||
<error> | Error | Missing or invalid group parameter. | 3.1 Beta 1 |
Notes
If you just want to know how many
...
items are in a group, it's much faster to use groupSize()
...
or groupSizes[].
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
if (typeof groupAdd == "undefined") { // WZ 3.1
this.groupAdd = groupAddDroid;
}
enumGroup(7).forEach( function moveToGroup6(obj) {
groupAdd(6, obj); // automatically removes it from group 7
} ); |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Include Page | ||||
---|---|---|---|---|
|