profectus-docs/assets/api_modules_features_conversion.md.1d4a5672.js

2 lines
16 KiB
JavaScript
Raw Normal View History

import{_ as e,c as t,o,N as a}from"./chunks/framework.0799945b.js";const m=JSON.parse('{"title":"Module: features/conversion","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/conversion.md","lastUpdated":null}'),r={name:"api/modules/features/conversion.md"},n=a('<h1 id="module-features-conversion" tabindex="-1">Module: features/conversion <a class="header-anchor" href="#module-features-conversion" aria-label="Permalink to &quot;Module: features/conversion&quot;"></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to &quot;Interfaces&quot;"></a></h2><ul><li><a href="../../interfaces/features/conversion.BaseConversion">BaseConversion</a></li><li><a href="../../interfaces/features/conversion.ConversionOptions">ConversionOptions</a></li></ul><h2 id="type-aliases" tabindex="-1">Type Aliases <a class="header-anchor" href="#type-aliases" aria-label="Permalink to &quot;Type Aliases&quot;"></a></h2><h3 id="conversion" tabindex="-1">Conversion <a class="header-anchor" href="#conversion" aria-label="Permalink to &quot;Conversion&quot;"></a></h3><p>Ƭ <strong>Conversion</strong>&lt;<code>T</code>&gt;: <a href="./feature#replace"><code>Replace</code></a>&lt;<code>T</code> &amp; <a href="../../interfaces/features/conversion.BaseConversion"><code>BaseConversion</code></a>, { <code>actualGain</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;actualGain&quot;</code>], <code>Ref</code>&lt;<a href="./../util/bignum#decimalsource"><code>DecimalSource</code></a>&gt;&gt; ; <code>buyMax</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;buyMax&quot;</code>], <code>true</code>&gt; ; <code>currentAt</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;currentAt&quot;</code>], <code>Ref</code>&lt;<a href="./../util/bignum#decimalsource"><code>DecimalSource</code></a>&gt;&gt; ; <code>currentGain</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;currentGain&quot;</code>], <code>Ref</code>&lt;<a href="./../util/bignum#decimalsource"><code>DecimalSource</code></a>&gt;&gt; ; <code>formula</code>: <a href="./../game/formulas/types#invertibleformula"><code>InvertibleFormula</code></a> ; <code>nextAt</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;nextAt&quot;</code>], <code>Ref</code>&lt;<a href="./../util/bignum#decimalsource"><code>DecimalSource</code></a>&gt;&gt; ; <code>spend</code>: <code>undefined</code> extends <code>T</code>[<code>&quot;spend&quot;</code>] ? (<code>amountGained</code>: <a href="./../util/bignum#decimalsource"><code>DecimalSource</code></a>) =&gt; <code>void</code> : <code>T</code>[<code>&quot;spend&quot;</code>] }&gt;</p><p>An object that converts one <a href="../../interfaces/features/resources/resource.Resource">Resource</a> into another at a given rate.</p><h4 id="type-parameters" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to &quot;Type parameters&quot;"></a></h4><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>T</code></td><td style="text-align:left;">extends <a href="../../interfaces/features/conversion.ConversionOptions"><code>ConversionOptions</code></a></td></tr></tbody></table><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/8c0a0c4/src/features/conversion.ts#L92" target="_blank" rel="noreferrer">profectus/src/features