Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
Return a list of buildable templates for the player... |
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var templates = enumTemplates(player); |
Parameters
Parameter | Type | Mandatory | Notes | Game version |
---|---|---|---|---|
player | Number | The player to whose templates should be listed. | 3.2 |
Return value
Value | Type | Notes | Game version |
---|---|---|---|
<templates> | Array of Template Object | If no templates are available, an empty array is returned. | 3.2 |
<error> | Error | Most likely an invalid player was specified. | 3.2 |
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
var templates = enumTemplates(me); var byCost = function(a, b) { return a.cost - b.cost; } templates.sort(byCost); var cheapest = templates[0]; var mostExpensive = templates[templates.length-1]; |
Div | |||||||
---|---|---|---|---|---|---|---|
| |||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|