import{_ as e,c as t,o as a,N as r}from"./chunks/framework.0799945b.js";const q=JSON.parse('{"title":"Module: game/requirements","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/game/requirements.md","lastUpdated":null}'),i={name:"api/modules/game/requirements.md"},n=r('
Ƭ CostRequirement: Replace
<Requirement
& CostRequirementOptions
, { cost
: ProcessedComputable
<DecimalSource
> | GenericFormula
; requiresPay
: ProcessedComputable
<boolean
> ; spendResources
: ProcessedComputable
<boolean
> ; visibility
: ProcessedComputable
<Visible
| None
| boolean
> }>
profectus/src/game/requirements.tsx:96
Ƭ Requirements: Requirement
| Requirement
[]
Utility type for accepting 1 or more Requirements.
profectus/src/game/requirements.tsx:64
▸ createBooleanRequirement(requirement
, display?
): Requirement
Creates a requirement based on a true/false value
Name | Type | Description |
---|---|---|
requirement | Computable <boolean > | The boolean requirement to use |
display? | CoercableComponent | How to display this requirement to the user |
profectus/src/game/requirements.tsx:205
▸ createCostRequirement<T
>(optionsFunc
): CostRequirement
Lazily creates a requirement with the given options, that is based on meeting an amount of a resource.
Name | Type |
---|---|
T | extends CostRequirementOptions |
Name | Type | Description |
---|---|---|
optionsFunc | () => T | Cost requirement options. |
profectus/src/game/requirements.tsx:110
▸ createVisibilityRequirement(feature
): Requirement
Utility function for creating a requirement that a specified vue feature is visible
Name | Type | Description |
---|---|---|
feature | Object | The feature to check the visibility of |
feature.visibility | ProcessedComputable <boolean | Visibility > | - |
profectus/src/game/requirements.tsx:190
▸ displayRequirements(requirements
, amount?
): Element
Utility function for display 1+ requirements compactly.
Name | Type | Default value | Description |
---|---|---|---|
requirements | Requirements | undefined | The 1+ requirements to display |
amount | DecimalSource | 1 | The amount of levels earned to be displayed |
Element
profectus/src/game/requirements.tsx:252
▸ maxRequirementsMet(requirements
): DecimalSource
Calculates the maximum number of levels that could be acquired with the current requirement states. True/false requirements will be counted as Infinity or 0.
Name | Type | Description |
---|---|---|
requirements | Requirements | The 1+ requirements to check |
profectus/src/game/requirements.tsx:234
▸ payByDivision(this
, amount?
): void
Name | Type |
---|---|
this | CostRequirement |
amount? | DecimalSource |
void
profectus/src/game/requirements.tsx:302
▸ payByReset(overrideDefaultValue?
): (this
: CostRequirement
) => void
Name | Type |
---|---|
overrideDefaultValue? | DecimalSource |
fn
▸ (this
): void
Name | Type |
---|---|
this | CostRequirement |
void
profectus/src/game/requirements.tsx:314
▸ payRequirements(requirements
, amount?
): void
Utility function for paying the costs for 1+ requirements
Name | Type | Default value | Description |
---|---|---|---|
requirements | Requirements | undefined | The 1+ requirements to pay |
amount | DecimalSource | 1 | How many levels to pay for |
void
profectus/src/game/requirements.tsx:294
▸ requirementsMet(requirements
): boolean
Utility for checking if 1+ requirements are all met
Name | Type | Description |
---|---|---|
requirements | Requirements | The 1+ requirements to check |
boolean