1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
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('<p><a href="./../../../">Profectus</a> / <a href="./../">game/requirements</a> / CostRequirement</p><h1 id="interface-costrequirement" tabindex="-1">Interface: CostRequirement <a class="header-anchor" href="#interface-costrequirement" aria-label="Permalink to "Interface: CostRequirement""></a></h1><p>An object that can be used to describe a requirement to perform some purchase or other action.</p><h2 id="see" tabindex="-1">See <a class="header-anchor" href="#see" aria-label="Permalink to "See""></a></h2><p><a href="./../functions/createCostRequirement">createCostRequirement</a></p><h2 id="extends" tabindex="-1">Extends <a class="header-anchor" href="#extends" aria-label="Permalink to "Extends""></a></h2><ul><li><a href="./Requirement"><code>Requirement</code></a></li></ul><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to "Properties""></a></h2><h3 id="canmaximize" tabindex="-1">canMaximize? <a class="header-anchor" href="#canmaximize" aria-label="Permalink to "canMaximize?""></a></h3><blockquote><p><code>optional</code> <strong>canMaximize</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<code>boolean</code>></p></blockquote><p>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.</p><h4 id="inherited-from" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./Requirement"><code>Requirement</code></a>.<a href="./Requirement#canmaximize"><code>canMaximize</code></a></p><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L40" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:40</a></p><hr><h3 id="cost" tabindex="-1">cost <a class="header-anchor" href="#cost" aria-label="Permalink to "cost""></a></h3><blockquote><p><strong>cost</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<a href="./../../../lib/break_eternity/type-aliases/DecimalSource"><code>DecimalSource</code></a>> | <a href="./../../formulas/types/type-aliases/GenericFormula"><code>GenericFormula</code></a></p></blockquote><p>The amount of <a href="./CostRequirement#resource">resource</a> 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 <a href="./CostRequirement#pay">pay</a> function.</p><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L99" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:99</a></p><hr><h3 id="cumulativecost" tabindex="-1">cumulativeCost <a class="header-anchor" href="#cumulativecost" aria-label="Permalink to "cumulativeCost""></a></h3><blockquote><p><strong>cumulativeCost</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<code>boolean</code>></p></blockquote><p>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.</p><h4 id="see-1" tabindex="-1">See <a class="header-anchor" href="#see-1" aria-label="Permalink to "See""></a></h4><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L104" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:104</a></p><hr><h3 id="directsum" tabindex="-1">directSum? <a class="header-anchor" href="#directsum" aria-label="Permalink to "directSum?""></a></h3><blockquote><p><code>optional</code> <strong>directSum</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<code>number</code>></p></blockquote><p>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.</p><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L112" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:112</a></p><hr><h3 id="display" tabindex="-1">display()? <a class="header-anchor" href="#display" aria-label="Permalink to "display()?""></a></h3><blockquote><p><code>optional</code> <strong>display</strong>: (<code>amount</code>?) => <a href="./../../../util/vue/type-aliases/Renderable"><code>Renderable</code></a></p></blockquote><p>The display for this specific requirement. Required if <a href="./Requirement#visibility">visibility</a> can be <a href="./../../../features/feature/enumerations/Visibility#visible">Visibility.Visible</a>.</p><h4 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h4><h5 id="amount" tabindex="-1">amount? <a class="header-anchor" href="#amount" aria-label="Permalink to "amount?""></a></h5><p><a href="./../../../lib/break_eternity/type-aliases/DecimalSource"><code>DecimalSource</code></a></p><h4 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h4><p><a href="./../../../util/vue/type-aliases/Renderable"><code>Renderable</code></a></p><h4 id="inherited-from-1" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-1" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./Requirement"><code>Requirement</code></a>.<a href="./Requirement#display"><code>display</code></a></p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L24" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:24</a></p><hr><h3 id="maxbulkamount" tabindex="-1">maxBulkAmount? <a class="header-anchor" href="#maxbulkamount" aria-label="Permalink to "maxBulkAmount?""></a></h3><blockquote><p><code>optional</code> <strong>maxBulkAmount</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<a href="./../../../lib/break_eternity/type-aliases/DecimalSource"><code>DecimalSource</code></a>></p></blockquote><p>Upper limit on levels that can be performed at once. Defaults to 1.</p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L108" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:108</a></p><hr><h3 id="partialdisplay" tabindex="-1">partialDisplay()? <a class="header-anchor" href="#partialdisplay" aria-label="Permalink to "partialDisplay()?""></a></h3><blockquote><p><code>optional</code> <strong>partialDisplay</strong>: (<code>amount</code>?) => <a href="./../../../util/vue/type-aliases/Renderable"><code>Renderable</code></a></p></blockquote><p>The display for this specific requirement. This is used for displays multiple requirements condensed. Required if <a href="./Requirement#visibility">visibility</a> can be <a href="./../../../features/feature/enumerations/Visibility#visible">Visibility.Visible</a>.</p><h4 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h4><h5 id="amount-1" tabindex="-1">amount? <a class="header-anchor" href="#amount-1" aria-label="Permalink to "amount?""></a></h5><p><a href="./../../../lib/break_eternity/type-aliases/DecimalSource"><code>DecimalSource</code></a></p><h4 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h4><p><a href="./../../../util/vue/type-aliases/Renderable"><code>Renderable</code></a></p><h4 id="inherited-from-2" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-2" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./Requirement"><code>Requirement</code></a>.<a href="./Requirement#partialdisplay"><code>partialDisplay</code></a></p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L20" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:20</a></p><hr><h3 id="pay" tabindex="-1">pay()? <a class="header-anchor" href="#pay" aria-label="Permalink to "pay()?""></a></h3><blockquote><p><code>optional</code> <strong>pay</strong>: (<code>amount</code>?) => <code>void</code></p></blockquote><p>Pass-through to <a href="./Requirement#pay">Requirement.pay</a>. May be required for maximizing support.</p><h4 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h4><h5 id="amount-2" tabindex="-1">amount? <a class="header-anchor" href="#amount-2" aria-label="Permalink to "amount?""></a></h5><p><a href="./../../../lib/break_eternity/type-aliases/DecimalSource"><code>DecimalSource</code></a></p><h4 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h4><p><code>void</code></p><h4 id="see-2" tabindex="-1">See <a class="header-anchor" href="#see-2" aria-label="Permalink to "See""></a></h4><p><a href="./CostRequirement#cost">cost</a> for restrictions on maximizing support.</p><h4 id="overrides" tabindex="-1">Overrides <a class="header-anchor" href="#overrides" aria-label="Permalink to "Overrides""></a></h4><p><a href="./Requirement"><code>Requirement</code></a>.<a href="./Requirement#pay"><code>pay</code></a></p><h4 id="defined-in-7" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-7" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L117" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:117</a></p><hr><h3 id="requirementmet" tabindex="-1">requirementMet <a class="header-anchor" href="#requirementmet" aria-label="Permalink to "requirementMet""></a></h3><blockquote><p><strong>requirementMet</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<code>boolean</code> | <a href="./../../../lib/break_eternity/type-aliases/DecimalSource"><code>DecimalSource</code></a>></p></blockquote><p>Whether or not this requirement has been met.</p><h4 id="inherited-from-3" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-3" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./Requirement"><code>Requirement</code></a>.<a href="./Requirement#requirementmet"><code>requirementMet</code></a></p><h4 id="defined-in-8" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-8" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L32" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:32</a></p><hr><h3 id="requirespay" tabindex="-1">requiresPay <a class="header-anchor" href="#requirespay" aria-label="Permalink to "requiresPay""></a></h3><blockquote><p><strong>requiresPay</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<code>boolean</code>></p></blockquote><p>Whether or not this requirement will need to affect the game state when whatever is using this requirement gets triggered.</p><h4 id="inherited-from-4" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-4" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./Requirement"><code>Requirement</code></a>.<a href="./Requirement#requirespay"><code>requiresPay</code></a></p><h4 id="defined-in-9" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-9" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L36" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:36</a></p><hr><h3 id="resource" tabindex="-1">resource <a class="header-anchor" href="#resource" aria-label="Permalink to "resource""></a></h3><blockquote><p><strong>resource</strong>: <a href="./../../../features/resources/resource/interfaces/Resource"><code>Resource</code></a></p></blockquote><p>The resource that will be checked for meeting the <a href="./CostRequirement#cost">cost</a>.</p><h4 id="defined-in-10" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-10" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L95" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:95</a></p><hr><h3 id="visibility" tabindex="-1">visibility <a class="header-anchor" href="#visibility" aria-label="Permalink to "visibility""></a></h3><blockquote><p><strong>visibility</strong>: <a href="https://vuejs.org/api/utility-types.html#mayberef" target="_blank" rel="noreferrer"><code>MaybeRef</code></a><<code>boolean</code> | <a href="./../../../features/feature/enumerations/Visibility"><code>Visibility</code></a>></p></blockquote><p>Whether or not this requirement should be displayed in Vue Features. <a href="./../functions/displayRequirements">displayRequirements</a> will respect this property.</p><h4 id="inherited-from-5" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-5" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./Requirement"><code>Requirement</code></a>.<a href="./Requirement#visibility"><code>visibility</code></a></p><h4 id="defined-in-11" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-11" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/requirements.tsx#L28" target="_blank" rel="noreferrer">profectus/src/game/requirements.tsx:28</a></p>',111)]))}const f=a(o,[["render",n]]);export{m as __pageData,f as default};
|