profectus-docs/assets/api_modules_game_requirements.md.25c013fc.js

2 lines
25 KiB
JavaScript
Raw Normal View History

import{_ as e,c as t,o as r,N as a}from"./chunks/framework.0799945b.js";const p=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"},o=a('<h1 id="module-game-requirements" tabindex="-1">Module: game/requirements <a class="header-anchor" href="#module-game-requirements" aria-label="Permalink to &quot;Module: game/requirements&quot;"></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to &quot;Interfaces&quot;"></a></h2><h3 id="costrequirementoptions" tabindex="-1">CostRequirementOptions <a class="header-anchor" href="#costrequirementoptions" aria-label="Permalink to &quot;CostRequirementOptions&quot;"></a></h3><p> <strong>CostRequirementOptions</strong>: <code>Object</code></p><p>An object that configures a <a href="./requirements#requirement">Requirement</a> based on a resource cost.</p><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>cost</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>&gt; | <a href="./formulas/types#genericformula"><code>GenericFormula</code></a></td><td style="text-align:left;">The amount of <a href="./requirements#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&#39;t pass a formula then you can still support maximizing by passing a custom <a href="./requirements#pay">pay</a> function.</td></tr><tr><td style="text-align:left;"><code>pay?</code></td><td style="text-align:left;">(<code>amount?</code>: <a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) =&gt; <code>void</code></td><td style="text-align:left;">Pass-through to <a href="./requirements#pay">pay</a>. May be required for maximizing support. <strong><code>See</code></strong> <a href="./requirements#cost">cost</a> for restrictions on maximizing support.</td></tr><tr><td style="text-align:left;"><code>requiresPay?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">Pass-through to <a href="./requirements#requirespay">requiresPay</a>. If not set to false, the default <a href="./requirements#pay">pay</a> function will remove <a href="./requirements#cost">cost</a> from <a href="./requirements#resource">resource</a>.</td></tr><tr><td style="text-align:left;"><code>resource</code></td><td style="text-align:left;"><a href="./../features/resource#resource"><code>Resource</code></a>&lt;<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>&gt;</td><td style="text-align:left;">The resource that will be checked for meeting the <a href="./requirements#cost">cost</a>.</td></tr><tr><td style="text-align:left;"><code>spendResources?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">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. <strong><code>See</code></strong></td></tr><tr><td style="text-align:left;"><code>visibility?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<code>boolean</code> | <a href="./../features/feature#visible"><code>Visible</code></a> | <a href="./../features/feature#none"><code>None</code></a