Class: Foundation

Foundation()

new Foundation()

Source:

Methods

AddBuilder(builderEnt)

Parameters:
Name Type Description
builderEnt number The entity to add.
Source:

AddBuilderHelper(builderEnt) → {boolean}

Parameters:
Name Type Description
builderEnt number The entity to add.
Source:
Returns:
- Whether the addition was successful.
Type
boolean

AddBuilders(builders)

Parameters:
Name Type Description
builders Array.<number> An array containing the entity IDs of builders to assign.
Source:

Build()

Perform some number of seconds of construction work. Returns true if the construction is completed.
Source:

CalculateBuildMultiplier()

The build multiplier is a penalty that is applied to each builder. For example, ten women build at a combined rate of 10^0.7 = 5.01 instead of 10.
Source:

Commit() → {boolean}

Source:
Returns:
- Whether the foundation has been committed sucessfully.
Type
boolean

CreateConstructionPreview()

Create preview entity and copy various parameters from the foundation.
Source:

GetBuilders() → {Array.<number>}

Source:
Returns:
- An array containing the entity IDs of assigned builders.
Type
Array.<number>

GetBuildProgress()

Returns the current build progress in a [0,1] range.
Source:

HandleBuildersChanged()

This has to be called whenever the number of builders change.
Source:

OnHealthChanged()

Moving the revelation logic from Build to here makes the building sink if it is attacked.
Source:

RemoveBuilder(builderEnt)

Parameters:
Name Type Description
builderEnt number The entity to remove.
Source: