Class: World

World()

A container for all the clicker objects

Constructor

new World()

Constructs a new world. All the other components require an existing "world" to function. A world is a container for the whole system.

Author:
  • Harri Pellikka
Source:

Methods

addAutomator(automator)

Registers a new automator to the world.

Parameters:
Name Type Description
automator

to register

Source:

addCurrency()

Registers a new currency in the world, making the currency usable.

Source:

addGenerator(generator)

Adds a new generator to this world

Parameters:
Name Type Description
generator

Generator to add

Source:

addModifier(modifier)

Registers a new modifier

Parameters:
Name Type Description
modifier

to register

Source:

disableAutomators()

Disables all automators

Source:

enableAutomators()

Enables all automators

Source:

getAutomators()

Retrieves all the automators registered in the world

Source:
Returns:

list of automators

getCurrencies()

Retrieves a list of all the currencies currently registered in the world.

Source:
Returns:

list of currencies

getCurrency(index)

Retrieves a currency at the given index. The index is based on the order in which the currencies were added to the world.

Parameters:
Name Type Description
index

of the currency

Source:
Returns:

the currency at the given index, or null if not found

getGeneratorCount()

Returns the number of generators in this world

Source:
Returns:

The number of generators in this world

getModifiers()

Retrieves all the modifiers registered in the world

Source:
Returns:

list of modifiers

getSpeedMultiplier()

Retrieves the global speed multiplier

Source:
Returns:

the speed multiplier

isAutomationEnabled()

Queries whether or not the automators are enabled.

Source:
Returns:

True if automation is enabled, false otherwise.

removeAllCurrencies()

Removes all currencies registered in the world.

Source:

removeAllGenerators()

Removes all the generators from this world

Source:

removeAutomator(automator)

Removes an automator from the world

Parameters:
Name Type Description
automator

to remove

Source:

removeCurrency()

Removes a currency from the world.

Source:

removeGenerator(generator)

Removes a generator

Parameters:
Name Type Description
generator

Generator to remove

Source:

removeModifier(modifier)

Removes a modifier from the world

Parameters:
Name Type Description
modifier

to remove

Source:

setSpeedMultiplier(multiplier)

Sets the global speed multiplier

Parameters:
Name Type Description
multiplier

of the world update speed

Source:

update(seconds)

Advances the world state by the given amount of seconds. Useful when calculating away-from-keyboard income etc.

Parameters:
Name Type Description
seconds

Seconds to advance

Source: