Versions Compared

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
themeRDark
languagejavascript
linenumberstrue
var templates = enumTemplates(player);

Parameters

ParameterTypeMandatoryNotesGame version
playerNumber(tick)The player to whose templates should be listed.(question)3.2

Return value

ValueTypeNotesGame version
<templates>Array of
Template Object
If no templates are available, an empty array is returned.(question)3.2
<error>ErrorMost likely an invalid player was specified.(question)3.2

Example

Code Block
themeRDark
languagejavascript
titleSort templates by cost
linenumberstrue
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
classbox
Availability
Status
colourYellow
title
?
3.2+

Requires:

  • Warzone (question) 3.2 or above
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5