Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Similar to orderDroidObj() but for a group of droids |
Code
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function orderGroupObj(group,dorder,obj) {
enumGroup(group).forEach(function(droid) {
if (droid.type==DROID) orderDroidObj(droid,dorder,obj);
});
} |
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
// when attacked, tell all droids in a "retalliationGroup" to attack the attacker eventAttacked = function(victim,attacker) { orderGroupObj(retalliationGroup, DORDER_ATTACK, attacker); } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|