Skip to content

industry_productivity_util

Source: base/tealdef/industries/industry_productivity_util.d.tl

Notes

Types of /industries/industry_productivity_util.tl (IndustryProductivityUtil): helpers for the worker boost of industries, which raises an industry's productivity while enough workers arrive by line.

IndustryProductivityUtil

record global base/tealdef/industries/industry_productivity_util.d.tl:3

global record IndustryProductivityUtil

Notes

Worker boost helpers returned by ug_require "/industries/industry_productivity_util.tl".

Fields

Name Type Description
workersTimeIntervalMax integer How long a worker visit counts, two game years (2 * api.util.getDefaultYearDuration()).
RequiredWorkersFractionForBoost number Share of the person capacity that must be filled with workers for the boost (0.5).

Functions

getIndustryWorkersState(Engine.Entity) : IndustriesWorkersState.IndustryState base/tealdef/industries/industry_productivity_util.d.tl:6

Notes

Reads the worker state of one industry from the industry_workers game script.

Returns IndustriesWorkersState.IndustryState: The state, or nil if the script or the industry has none.

isIndustryWorkersBoosted(Engine.Entity, numWorkers? : integer) : boolean base/tealdef/industries/industry_productivity_util.d.tl:7

Notes

True if at least half of the industry's person capacity (RequiredWorkersFractionForBoost) arrived as workers.

Parameter Type Description
#1 Engine.Entity
numWorkers? integer Number of workers to test; defaults to the number of recent visitors.

Returns boolean

getVisitors(Engine.Entity) : {IndustriesWorkersState.IndustryState.Visitor} base/tealdef/industries/industry_productivity_util.d.tl:8

Notes

The workers that recently reached the industry by line (empty if none).

Returns {IndustriesWorkersState.IndustryState.Visitor}

getIndustryProductivity(Engine.Entity) : number base/tealdef/industries/industry_productivity_util.d.tl:9

Notes

The productivity modifier of the industry's stock list; above 1.0 while boosted, 0 without a stock list.

Returns number

getPersonCapacityPotentialBoost(Engine.Entity) : number base/tealdef/industries/industry_productivity_util.d.tl:10

Notes

The productivity factor the industry gets when boosted.

Returns number: workersBoostFactor from the construction's metadata if set, otherwise a value between 1.5 and 2.5 derived from the construction seed (2 if there is no seed).