import{_ as a,c as r,a0 as t,o as i}from"./chunks/framework.P9qPzDnn.js";const m=JSON.parse('{"title":"Interface: CostRequirement","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/game/requirements/interfaces/CostRequirement.md","filePath":"api/game/requirements/interfaces/CostRequirement.md","lastUpdated":null}'),o={name:"api/game/requirements/interfaces/CostRequirement.md"};function n(s,e,c,l,d,u){return i(),r("div",null,e[0]||(e[0]=[t('
Profectus / game/requirements / CostRequirement
An object that can be used to describe a requirement to perform some purchase or other action.
optional
canMaximize:MaybeRef
<boolean
>
Whether or not this requirement can have multiple levels of requirements that can be met at once. Requirement is assumed to not have multiple levels if this property not present.
profectus/src/game/requirements.tsx:40
cost:
MaybeRef
<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:99
cumulativeCost:
MaybeRef
<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.
profectus/src/game/requirements.tsx:104
optional
directSum:MaybeRef
<number
>
When calculating requirement for multiple levels, how many should be directly summed for increase accuracy. High numbers can cause lag. Defaults to 10 if cumulative cost, 0 otherwise.
profectus/src/game/requirements.tsx:112
optional
display: (amount
?) =>Renderable
The display for this specific requirement. Required if visibility can be Visibility.Visible.
profectus/src/game/requirements.tsx:24
optional
maxBulkAmount:MaybeRef
<DecimalSource
>
Upper limit on levels that can be performed at once. Defaults to 1.
profectus/src/game/requirements.tsx:108
optional
partialDisplay: (amount
?) =>Renderable
The display for this specific requirement. This is used for displays multiple requirements condensed. Required if visibility can be Visibility.Visible.
profectus/src/game/requirements.tsx:20
optional
pay: (amount
?) =>void
Pass-through to Requirement.pay. May be required for maximizing support.
void
cost for restrictions on maximizing support.
profectus/src/game/requirements.tsx:117
requirementMet:
MaybeRef
<boolean
|DecimalSource
>
Whether or not this requirement has been met.
profectus/src/game/requirements.tsx:32
requiresPay:
MaybeRef
<boolean
>
Whether or not this requirement will need to affect the game state when whatever is using this requirement gets triggered.
profectus/src/game/requirements.tsx:36
resource:
Resource
The resource that will be checked for meeting the cost.
profectus/src/game/requirements.tsx:95
visibility:
MaybeRef
<boolean
|Visibility
>
Whether or not this requirement should be displayed in Vue Features. displayRequirements will respect this property.