Skip to content

continent_placeholders

test edited this page Aug 14, 2024 · 16 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: ^

continent Selectors

  • CONTINENT: One of the entity values Example: NORTH_AMERICA, SOUTH_AMERICA, EUROPE, AFRICA, ASIA, AUSTRALIA, ANTARCTICA

Sheet Columns

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


Placeholders


#canBuild - boolean

This command is public

If the given building can be built on this continent

Arguments:

<building> - Building A city building type


#getAverage - double

This command is public

Returns the total value of the given attribute per nation

Arguments:

<attribute> - NationAttributeDouble A completed nation attribute that accepts no arguments and returns a number To get the attribute for an attribute with arguments, you must provide a value in brackets See: https://github.com/xdnw/locutus/wiki/nation_placeholders [filter] - NationFilter A comma separated list of filters (can include nations and alliances)


#getAveragePer - double

This command is public

Returns the average value of the given attribute per another attribute (such as cities)

Arguments:

<attribute> - NationAttributeDouble A completed nation attribute that accepts no arguments and returns a number To get the attribute for an attribute with arguments, you must provide a value in brackets See: https://github.com/xdnw/locutus/wiki/nation_placeholders <per> - NationAttributeDouble [filter] - NationFilter A comma separated list of filters (can include nations and alliances)


#getBuildings - Set<Building>

This command is public

Returns the buildings that are available on this continent

This command has no arguments


#getFoodRatio - double

This command is public

Returns the food production ratio for this continent (0.0 - 1.0)

This command has no arguments


#getName - String

This command is public

Returns the name of the continent

This command has no arguments


#getNumNations - int

This command is public

Number of nations on this continent

Arguments:

[filter] - NationFilter A comma separated list of filters (can include nations and alliances)


#getOrdinal - int

This command is public

The ordinal of this continent

This command has no arguments


#getRadIndex - double

This command is public

Returns the radiation index for this continent

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


#getResources - List<ResourceType>

This command is public

The resources that are available on this continent

This command has no arguments


#getSeasonModifier - double

This command is public

Returns the season modifier for this continent

This command has no arguments


#getSeasonModifierDate - double

This command is public

Returns the season modifier for this continent at the given date

Arguments:

<date> - long[Timestamp] A unix timestamp, a DMY date or a time difference that will resolve to a timestamp from the current date


#getTotal - double

This command is public

Returns the total value of the given attribute for the nations

Arguments:

<attribute> - NationAttributeDouble A completed nation attribute that accepts no arguments and returns a number To get the attribute for an attribute with arguments, you must provide a value in brackets See: https://github.com/xdnw/locutus/wiki/nation_placeholders [filter] - NationFilter A comma separated list of filters (can include nations and alliances)


#hasResource - boolean

This command is public

If this continent has the given resource

Arguments:

<type> - ResourceType The name of a resource


#isNorth - boolean

This command is public

If this continent is in the northern hemisphere

This command has no arguments


Clone this wiki locally