Skip to content

Profectus / features/clickables/upgrade / setupAutoPurchase

Function: setupAutoPurchase() ​

setupAutoPurchase(layer, autoActive, upgrades): void

Utility to auto purchase a list of upgrades whenever they're affordable.

Parameters ​

layer ​

Layer

The layer the upgrades are apart of

autoActive ​

MaybeRefOrGetter<boolean>

Whether or not the upgrades should currently be auto-purchasing

upgrades ​

Upgrade[] = []

The specific upgrades to upgrade. If unspecified, uses all upgrades on the layer.

Returns ​

void

Defined in ​

profectus/src/features/clickables/upgrade.tsx:160