1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
import{_ as e,c as a,o as r,N as o}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Interface: ConversionOptions","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/interfaces/features/conversion.ConversionOptions.md","lastUpdated":null}'),t={name:"api/interfaces/features/conversion.ConversionOptions.md"},n=o('<h1 id="interface-conversionoptions" tabindex="-1">Interface: ConversionOptions <a class="header-anchor" href="#interface-conversionoptions" aria-label="Permalink to "Interface: ConversionOptions""></a></h1><p><a href="./../../modules/features/conversion">features/conversion</a>.ConversionOptions</p><p>An object that configures a <a href="./../../modules/features/conversion#conversion">Conversion</a>.</p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to "Properties""></a></h2><h3 id="actualgain" tabindex="-1">actualGain <a class="header-anchor" href="#actualgain" aria-label="Permalink to "actualGain""></a></h3><p>• <code>Optional</code> <strong>actualGain</strong>: <a href="./../../modules/util/computed#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></p><p>The absolute amount the output resource will be changed by. Typically this will be set for you in a conversion constructor. This will differ from <a href="./conversion.ConversionOptions#currentgain">currentGain</a> in the cases where the conversion isn't just adding the converted amount to the output resource.</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L38" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:38</a></p><hr><h3 id="baseresource" tabindex="-1">baseResource <a class="header-anchor" href="#baseresource" aria-label="Permalink to "baseResource""></a></h3><p>• <strong>baseResource</strong>: <a href="./resources/resource.Resource"><code>Resource</code></a><<a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></p><p>The input <a href="./resources/resource.Resource">Resource</a> for this conversion.</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L53" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:53</a></p><hr><h3 id="buymax" tabindex="-1">buyMax <a class="header-anchor" href="#buymax" aria-label="Permalink to "buyMax""></a></h3><p>• <code>Optional</code> <strong>buyMax</strong>: <a href="./../../modules/util/computed#computable"><code>Computable</code></a><<code>boolean</code>></p><p>Whether or not to cap the amount of the output resource gained by converting at 1. Defaults to true.</p><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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L62" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:62</a></p><hr><h3 id="convert" tabindex="-1">convert <a class="header-anchor" href="#convert" aria-label="Permalink to "convert""></a></h3><p>• <code>Optional</code> <strong>convert</strong>: <code>VoidFunction</code></p><p>The function that performs the actual conversion from <a href="./conversion.ConversionOptions#baseresource">baseResource</a> to <a href="./conversion.ConversionOptions#gainresource">gainResource</a>. Typically this will be set for you in a conversion constructor.</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L67" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:67</a></p><hr><h3 id="currentat" tabindex="-1">currentAt <a class="header-anchor" href="#currentat" aria-label="Permalink to "currentAt""></a></h3><p>• <code>Optional</code> <strong>currentAt</strong>: <a href="./../../modules/util/computed#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></p><p>The amount of the input resource currently being required in order to produce the <a href="./conversion.ConversionOptions#currentgain">currentGain</a>. That is, if it went below this value then <a href="./conversion.ConversionOptions#currentgain">currentGain</a> would decrease. Typically this will be set for you in a conversion constructor.</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L44" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:44</a></p><hr><h3 id="currentgain" tabindex="-1">currentGain <a class="header-anchor" href="#currentgain" aria-label="Permalink to "currentGain""></a></h3><p>• <code>Optional</code> <strong>currentGain</strong>: <a href="./../../modules/util/computed#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></p><p>How much of the output resource the conversion can currently convert for. Typically this will be set for you in a conversion constructor.</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L32" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:32</a></p><hr><h3 id="formula" tabindex="-1">formula <a class="header-anchor" href="#formula" aria-label="Permalink to "formula""></a></h3><p>• <strong>formula</strong>: (<code>variable</code>: <a href="./../../modules/game/formulas/types#genericformula"><code>GenericFormula</code></a> & { <code>invert</code>: (<code>value</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a> } & { <code>evaluateIntegral</code>: (<code>variable?</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a> } & { <code>invertIntegral</code>: (<code>value</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a> }) => <a href="./../../modules/game/formulas/types#invertibleformula"><code>InvertibleFormula</code></a></p><h4 id="type-declaration" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>variable</code>): <a href="./../../modules/game/formulas/types#invertibleformula"><code>InvertibleFormula</code></a></p><p>The formula used to determine how much <a href="./conversion.ConversionOptions#gainresource">gainResource</a> should be earned by this converting. The passed value will be a Formula representing the <a href="./conversion.ConversionOptions#baseresource">baseResource</a> variable.</p><h5 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>variable</code></td><td style="text-align:left;"><a href="./../../modules/game/formulas/types#genericformula"><code>GenericFormula</code></a> & { <code>invert</code>: (<code>value</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a> } & { <code>evaluateIntegral</code>: (<code>variable?</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a> } & { <code>invertIntegral</code>: (<code>value</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a> }</td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h5><p><a href="./../../modules/game/formulas/types#invertibleformula"><code>InvertibleFormula</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L25" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:25</a></p><hr><h3 id="gainresource" tabindex="-1">gainResource <a class="header-anchor" href="#gainresource" aria-label="Permalink to "gainResource""></a></h3><p>• <strong>gainResource</strong>: <a href="./resources/resource.Resource"><code>Resource</code></a><<a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></p><p>The output <a href="./resources/resource.Resource">Resource</a> for this conversion. i.e. the resource being generated.</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L57" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:57</a></p><hr><h3 id="nextat" tabindex="-1">nextAt <a class="header-anchor" href="#nextat" aria-label="Permalink to "nextAt""></a></h3><p>• <code>Optional</code> <strong>nextAt</strong>: <a href="./../../modules/util/computed#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></p><p>The amount of the input resource required to make <a href="./conversion.ConversionOptions#currentgain">currentGain</a> increase. Typically this will be set for you in a conversion constructor.</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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L49" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:49</a></p><hr><h3 id="onconvert" tabindex="-1">onConvert <a class="header-anchor" href="#onconvert" aria-label="Permalink to "onConvert""></a></h3><p>• <code>Optional</code> <strong>onConvert</strong>: (<code>amountGained</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <code>void</code></p><h4 id="type-declaration-1" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-1" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>amountGained</code>): <code>void</code></p><p>A callback that happens after a conversion has been completed. Receives the amount gained via conversion. This will not be called whenever using currentGain without calling convert (e.g. passive generation)</p><h5 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>amountGained</code></td><td style="text-align:left;"><a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a></td></tr></tbody></table><h5 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L78" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:78</a></p><hr><h3 id="spend" tabindex="-1">spend <a class="header-anchor" href="#spend" aria-label="Permalink to "spend""></a></h3><p>• <code>Optional</code> <strong>spend</strong>: (<code>amountGained</code>: <a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <code>void</code></p><h4 id="type-declaration-2" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-2" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>amountGained</code>): <code>void</code></p><p>The function that spends the <a href="./conversion.ConversionOptions#baseresource">baseResource</a> as part of the conversion. Defaults to setting the <a href="./conversion.ConversionOptions#baseresource">baseResource</a> amount to 0.</p><h5 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h5><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>amountGained</code></td><td style="text-align:left;"><a href="./../../modules/lib/break_eternity#decimalsource"><code>DecimalSource</code></a></td></tr></tbody></table><h5 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></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://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/conversion.ts#L72" target="_blank" rel="noreferrer">profectus/src/features/conversion.ts:72</a></p>',87),i=[n];function c(s,d,l,u,h,f){return r(),a("div",null,i)}const m=e(t,[["render",c]]);export{b as __pageData,m as default};
|