Skip to content

resourcetype_placeholders

test edited this page Aug 14, 2024 · 10 revisions

This page contains a list of functions that can be used as PLACEHOLDERS and FILTERS

About Arguments

Some functions here may accept an argument. The brackets imply argument type, you do NOT include them when using the function.

  • <arg> - A required parameter
  • [arg] - An optional parameter
  • <arg1|arg2> - Multiple parameters options
  • <arg=value> - Default or suggested value
  • [-f flag] - A optional command argument flag

About Placeholders

Placeholders in a text, such as in a spreadsheet or message, are replaced with actual values.

Examples:

  • {myFunction}
  • {functionWithArgs(123)}
  • {withNamedArgs(myArg: 123 otherArg: 456)}
  • ({conditional}?{ifTrue}:{ifFalse})
  • 9-({numericalFunction}+5)*3

About filters

Filters are used to modify a selection. i.e. When you are choosing which things to act upon or display, you use filters to narrow down the selection to ones that meet a certain requirement. When the return type is a string, the filter can be compared using regex to the value. When the return type is boolean (true/false), it will be resolved to either 1 or 0

Examples:

  • #myBoolean,#myOtherTrueFalseFunction
  • (#myFunction=5||#myOtherFunction<10)
  • #textFunction=abc123,#regexFunction=efg.*
  • (#myFunction<(#myOtherFunction+5)

Operators

  • TERNARY: ?
  • GREATER_EQUAL: >=
  • GREATER: >
  • LESS_EQUAL: <=
  • LESS: <
  • NOT_EQUAL: !=
  • EQUAL: =
  • PLUS: +
  • MINUS: -
  • MULTIPLY: *
  • DIVIDE: /
  • POWER: ^

resourcetype Selectors

  • RESOURCETYPE: One of the entity values Example: MONEY, CREDITS, FOOD, COAL, OIL, URANIUM, LEAD, IRON, BAUXITE, GASOLINE, MUNITIONS, STEEL, ALUMINUM

Sheet Columns

A google sheet url with one of the following columns is accepted: resource


Placeholders


#canProduceInAny - boolean

This command is public

If this resource is on the given continent

Arguments:

<continents> - Set<Continent> A comma separated list of continents, or *


#getBaseInput - int

This command is public

The base input for this resource (if manufactured)

This command has no arguments


#getBoostFactor - double

This command is public

The project boost factor for this resource's production (if any)

This command has no arguments


#getBuilding - Building

This command is public

The building corresponding to this resource (if any)

This command has no arguments


#getCap - int

This command is public

The building cap for this resource's production

This command has no arguments


#getContinents - Set<Continent>

This command is public

Continents of this resource (if any)

This command has no arguments


#getGraphId - int

This command is public

The id of this resource on the graph

This command has no arguments


#getInputList - List<ResourceType>

This command is public

The input resources for this resource (if manufactured)

This command has no arguments


#getManufacturingMultiplier - double

This command is public

The input output ratio for this resource (if manufactured)

This command has no arguments


#getMarketValue - double

This command is public

The market value of this resource (weekly average)

This command has no arguments


#getName - String

This command is public

The name of this resource

This command has no arguments


#getPollution - int

This command is public

The pollution modifier for this resource's production

This command has no arguments


#getProduction - Map<ResourceType,Double>

This command is public

The total production of resources for nations

Arguments:

<nations> - Set<DBNation> A comma separated list of nations, alliances and filters <includeNegatives> - boolean


#getProject - Project

This command is public

The project required to boost this resource's production (if any)

This command has no arguments


#getResource - double

This command is public

Gets a resource amount from a map of resources

Arguments:

<resources> - Map<ResourceType, Double> A comma separated list of resources and their amounts <resource> - ResourceType The name of a resource


#getResourceValue - double

This command is public

Gets the total resource value for a map of resources

Arguments:

<resources> - Map<ResourceType, Double> A comma separated list of resources and their amounts


#getUpkeep - int

This command is public

The upkeep modifier for this resource's production

This command has no arguments


#hasBuilding - boolean

This command is public

If this resource has a corresponding building

This command has no arguments


#isManufactured - boolean

This command is public

If this is a manufactured resource

This command has no arguments


#isRaw - boolean

This command is public

If this is a raw resource

This command has no arguments


Clone this wiki locally