Make calculateMaxAffordable only accept spendResources values on supported formulas

This commit is contained in:
thepaperpilot 2023-02-05 00:26:24 -06:00
parent e45c822787
commit aa07793759

View file

@ -1998,7 +1998,17 @@ export default class Formula<T extends [FormulaSource] | FormulaSource[]> {
* @param spendResources Whether or not to count spent resources on each purchase or not * @param spendResources Whether or not to count spent resources on each purchase or not
*/ */
export function calculateMaxAffordable( export function calculateMaxAffordable(
formula: GenericFormula, formula: InvertibleFormula,
resource: Resource,
spendResources?: true
): { maxAffordable: ComputedRef<DecimalSource>; cost: ComputedRef<DecimalSource> };
export function calculateMaxAffordable(
formula: InvertibleIntegralFormula,
resource: Resource,
spendResources: Computable<boolean>
): { maxAffordable: ComputedRef<DecimalSource>; cost: ComputedRef<DecimalSource> };
export function calculateMaxAffordable(
formula: InvertibleFormula,
resource: Resource, resource: Resource,
spendResources: Computable<boolean> = true spendResources: Computable<boolean> = true
) { ) {