Template:API

From Zero-K
Jump to navigation Jump to search


{{API <!-- Callout example -->
|prefix = Spring
|name = UseTeamResource
|arg1 = {{type|number}} teamID
|arg2 = {{type|string}} "metal" {{pipe}} "energy"
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.
}}

Template:PrefixTemplate:NameTemplate:CodeStyle(Template:Type teamID, Template:Type Template:Value Template:Pipe Template:Value, Template:Type amount Template:Pipe { metal = Template:Type amount, energy = Template:Type amount })

Template:CodeStyle-> Template:Type Template:Pipe Template:Type hadEnough

Deduct the specified amount from the team's metal or energy resource.