Module: features/conversion

Interfaces

Type aliases

Conversion

Ƭ Conversion<T>: Replace<T & BaseConversion, { buyMax: GetComputableTypeWithDefault<T["buyMax"], true> ; currentGain: GetComputableTypeWithDefault<T["currentGain"], Ref<DecimalSource>> ; nextAt: GetComputableTypeWithDefault<T["nextAt"], Ref<DecimalSource>> ; roundUpCost: GetComputableTypeWithDefault<T["roundUpCost"], true> }>

Type parameters

NameType
Textends ConversionOptions

Defined in

profectus/src/features/conversion.ts:30


GenericConversion

Ƭ GenericConversion: Replace<Conversion<ConversionOptions>, { buyMax: ProcessedComputable<boolean> ; currentGain: ProcessedComputable<DecimalSource> ; nextAt: ProcessedComputable<DecimalSource> ; roundUpCost: ProcessedComputable<boolean> }>

Defined in

profectus/src/features/conversion.ts:40


ScalingFunction

Ƭ ScalingFunction: Object

Type declaration

NameType
currentGain(conversion: GenericConversion) => DecimalSource
nextAt(conversion: GenericConversion) => DecimalSource

Defined in

profectus/src/features/conversion.ts:93

Functions

addHardcap

addHardcap(scaling, cap): ScalingFunction

Parameters

NameType
scalingScalingFunction
capProcessedComputable<DecimalSource>

Returns

ScalingFunction

Defined in

profectus/src/features/conversion.ts:244


addSoftcap

addSoftcap(scaling, cap, power?): ScalingFunction

Parameters

NameTypeDefault value
scalingScalingFunctionundefined
capProcessedComputable<DecimalSource>undefined
powerProcessedComputable<DecimalSource>0.5

Returns

ScalingFunction

Defined in

profectus/src/features/conversion.ts:232


createConversion

createConversion<T>(optionsFunc): Conversion<T>

Type parameters

NameType
Textends ConversionOptions

Parameters

NameType
optionsFunc() => T & ThisType<Conversion<T>>

Returns

Conversion<T>

Defined in

profectus/src/features/conversion.ts:50


createCumulativeConversion

createCumulativeConversion<S>(optionsFunc): Conversion<S>

Type parameters

NameType
Sextends ConversionOptions

Parameters

NameType
optionsFunc() => S & ThisType<Conversion<S>>

Returns

Conversion<S>

Defined in

profectus/src/features/conversion.ts:166


createIndependentConversion

createIndependentConversion<S>(optionsFunc): Conversion<S>

Type parameters

NameType
Sextends ConversionOptions

Parameters

NameType
optionsFunc() => S & ThisType<Conversion<S>>

Returns

Conversion<S>

Defined in

profectus/src/features/conversion.ts:172


createLinearScaling

createLinearScaling(base, coefficient): ScalingFunction

Parameters

NameType
baseDecimalSource | Ref<DecimalSource>
coefficientDecimalSource | Ref<DecimalSource>

Returns

ScalingFunction

Defined in

profectus/src/features/conversion.ts:100


createPolynomialScaling

createPolynomialScaling(base, exponent): ScalingFunction

Parameters

NameType
baseDecimalSource | Ref<DecimalSource>
exponentDecimalSource | Ref<DecimalSource>

Returns

ScalingFunction

Defined in

profectus/src/features/conversion.ts:135


setupPassiveGeneration

setupPassiveGeneration(layer, conversion, rate?): void

Parameters

NameTypeDefault value
layerGenericLayerundefined
conversionGenericConversionundefined
rateProcessedComputable<DecimalSource>1

Returns

void

Defined in

profectus/src/features/conversion.ts:204