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('

Module: game/requirements

Interfaces

Type Aliases

CostRequirement

Ƭ CostRequirement: Replace<Requirement & CostRequirementOptions, { cost: ProcessedComputable<DecimalSource> | GenericFormula ; requiresPay: ProcessedComputable<boolean> ; spendResources: ProcessedComputable<boolean> ; visibility: ProcessedComputable<Visible | None | boolean> }>

Defined in

profectus/src/game/requirements.tsx:96


Requirements

Ƭ Requirements: Requirement | Requirement[]

Utility type for accepting 1 or more Requirements.

Defined in

profectus/src/game/requirements.tsx:64

Functions

createBooleanRequirement

createBooleanRequirement(requirement, display?): Requirement

Creates a requirement based on a true/false value

Parameters

NameTypeDescription
requirementComputable<boolean>The boolean requirement to use
display?CoercableComponentHow to display this requirement to the user

Returns

Requirement

Defined in

profectus/src/game/requirements.tsx:205


createCostRequirement

createCostRequirement<T>(optionsFunc): CostRequirement

Lazily creates a requirement with the given options, that is based on meeting an amount of a resource.

Type parameters

NameType
Textends CostRequirementOptions

Parameters

NameTypeDescription
optionsFunc() => TCost requirement options.

Returns

CostRequirement

Defined in

profectus/src/game/requirements.tsx:110


createVisibilityRequirement

createVisibilityRequirement(feature): Requirement

Utility function for creating a requirement that a specified vue feature is visible

Parameters

NameTypeDescription
featureObjectThe feature to check the visibility of
feature.visibilityProcessedComputable<boolean | Visibility>-

Returns

Requirement

Defined in

profectus/src/game/requirements.tsx:190


displayRequirements

displayRequirements(requirements, amount?): Element

Utility function for display 1+ requirements compactly.

Parameters

NameTypeDefault valueDescription
requirementsRequirementsundefinedThe 1+ requirements to display
amountDecimalSource1The amount of levels earned to be displayed

Returns

Element

Defined in

profectus/src/game/requirements.tsx:252


maxRequirementsMet

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.

Parameters

NameTypeDescription
requirementsRequirementsThe 1+ requirements to check

Returns

DecimalSource

Defined in

profectus/src/game/requirements.tsx:234


payByDivision

payByDivision(this, amount?): void

Parameters

NameType
thisCostRequirement
amount?DecimalSource

Returns

void

Defined in

profectus/src/game/requirements.tsx:302


payByReset

payByReset(overrideDefaultValue?): (this: CostRequirement) => void

Parameters

NameType
overrideDefaultValue?DecimalSource

Returns

fn

▸ (this): void

Parameters
NameType
thisCostRequirement
Returns

void

Defined in

profectus/src/game/requirements.tsx:314


payRequirements

payRequirements(requirements, amount?): void

Utility function for paying the costs for 1+ requirements

Parameters

NameTypeDefault valueDescription
requirementsRequirementsundefinedThe 1+ requirements to pay
amountDecimalSource1How many levels to pay for

Returns

void

Defined in

profectus/src/game/requirements.tsx:294


requirementsMet

requirementsMet(requirements): boolean

Utility for checking if 1+ requirements are all met

Parameters

NameTypeDescription
requirementsRequirementsThe 1+ requirements to check

Returns

boolean

Defined in

profectus/src/game/requirements.tsx:222

',109),o=[n];function s(l,d,c,u,h,m){return a(),t("div",null,o)}const p=e(i,[["render",s]]);export{q as __pageData,p as default};