import{_ as e,c as r,o as t,N as a}from"./chunks/framework.0799945b.js";const f=JSON.parse('{"title":"Interface: CostRequirementOptions","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/interfaces/game/requirements.CostRequirementOptions.md","lastUpdated":null}'),o={name:"api/interfaces/game/requirements.CostRequirementOptions.md"},i=a('
game/requirements.CostRequirementOptions
An object that configures a Requirement based on a resource cost.
• cost: Computable
<DecimalSource
> | GenericFormula
The amount of resource that must be met for this requirement. You can pass a formula, in which case maximizing will work out of the box (assuming its invertible and, for more accurate calculations, its integral is invertible). If you don't pass a formula then you can still support maximizing by passing a custom pay function.
profectus/src/game/requirements.tsx:75
• Optional
pay: (amount?
: DecimalSource
) => void
▸ (amount?
): void
Pass-through to pay. May be required for maximizing support.
See
cost for restrictions on maximizing support.
Name | Type |
---|---|
amount? | DecimalSource |
void
profectus/src/game/requirements.tsx:93
• Optional
requiresPay: Computable
<boolean
>
Pass-through to requiresPay. If not set to false, the default pay function will remove cost from resource.
profectus/src/game/requirements.tsx:83
• resource: Resource
<DecimalSource
>
The resource that will be checked for meeting the cost.
profectus/src/game/requirements.tsx:71
• Optional
spendResources: Computable
<boolean
>
When calculating multiple levels to be handled at once, whether it should consider resources used for each level as spent. Setting this to false causes calculations to be faster with larger numbers and supports more math functions.
See
profectus/src/game/requirements.tsx:88
• Optional
visibility: Computable
<boolean
| Visible
| None
>
Pass-through to visibility.