Skip to content

celestialobjectslogic.ts

github-actions[bot] edited this page Jun 19, 2023 · 4 revisions

Functions

docByExternal()void

Generates discovered section sentences

wikiCodePercentage(element)

Add percentage sign to e-sell/buy property data for wikiCode output.

autoInfested([element])boolean

Determines whether or not the given element is infested, and updates the page accordingly.

buildDescriptor(descriptor, planetClass, filler)string

Builds a descriptor for a planet based on its planet class.

initialiseSectionInputs(sectionSelector)void

Initialise form input fields.

docByExternal() ⇒ void

Generates discovered section sentences

Kind: global function

docByExternal~research() ⇒ string

Determines the research chapter sentence to use

Kind: inner method of docByExternal
Returns: string -

The research chapter sentence to use


docByExternal~discoverer() ⇒ string

Formats the name of the discoverer

Kind: inner method of docByExternal
Returns: string -

The formatted name of the discoverer


docByExternal~explorer() ⇒ string

Formats and generates sections to be used in the explorer string

Kind: inner method of docByExternal
Returns: string -

The final generated explorer string


docByExternal~formatDate(date) ⇒ string

Formats a given date to be in the format 'Month Day, Year'

Kind: inner method of docByExternal
Returns: string -

The formatted date in the format 'Month Day, Year'

Param Type Description
date string

The date to format in the format 'YYYY-MM-DD'

wikiCodePercentage(element)

Add percentage sign to e-sell/buy property data for wikiCode output.

Kind: global function

Param Type Default Description
element HTMLElement | null

the element to apply percentage formatting to.

autoInfested([element]) ⇒ boolean

Determines whether or not the given element is infested, and updates the page accordingly.

Kind: global function
Returns: boolean -

  • If on a System page, returns true if the element is Infested, false otherwise. If on a Planet/Moon page, updates the output text and pageData object accordingly, and returns nothing.
Param Type Default Description
[element] HTMLElement globalElements.input.descriptionInput

The element to check for infestation.

buildDescriptor(descriptor, planetClass, filler) ⇒ string

Builds a descriptor for a planet based on its planet class.

Kind: global function
Returns: string -

The constructed name for the planet.

Param Type Description
descriptor string

The descriptor to be used in the construction of the planet's name.

planetClass string

The classification of the planet, which will be incorporated into the constructed name.

filler string

A string to be added between the planet class and the descriptor for added emphasis in the name.

initialiseSectionInputs(sectionSelector) ⇒ void

Initialise form input fields.

Kind: global function

Param Type Description
sectionSelector string

CSS selector for the input fields to initialise.