From 757cfaa1ab23a853cfed2d396cad258b2690982b Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 5 Feb 2023 00:26:24 -0600 Subject: [PATCH] Make calculateMaxAffordable only accept spendResources values on supported formulas --- src/game/formulas.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/formulas.ts b/src/game/formulas.ts index 5b95c7f..0c95ba2 100644 --- a/src/game/formulas.ts +++ b/src/game/formulas.ts @@ -1998,7 +1998,17 @@ export default class Formula { * @param spendResources Whether or not to count spent resources on each purchase or not */ export function calculateMaxAffordable( - formula: GenericFormula, + formula: InvertibleFormula, + resource: Resource, + spendResources?: true +): { maxAffordable: ComputedRef; cost: ComputedRef }; +export function calculateMaxAffordable( + formula: InvertibleIntegralFormula, + resource: Resource, + spendResources: Computable +): { maxAffordable: ComputedRef; cost: ComputedRef }; +export function calculateMaxAffordable( + formula: InvertibleFormula, resource: Resource, spendResources: Computable = true ) {