1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
import{_ as e,c as r,o as t,a as o}from"./app.ab34650d.js";const m=JSON.parse('{"title":"Interface: ConversionOptions","description":"","frontmatter":{"editLink":false},"headers":[{"level":2,"title":"Properties","slug":"properties"},{"level":3,"title":"actualGain","slug":"actualgain"},{"level":3,"title":"baseResource","slug":"baseresource"},{"level":3,"title":"buyMax","slug":"buymax"},{"level":3,"title":"convert","slug":"convert"},{"level":3,"title":"costModifier","slug":"costmodifier"},{"level":3,"title":"currentAt","slug":"currentat"},{"level":3,"title":"currentGain","slug":"currentgain"},{"level":3,"title":"gainModifier","slug":"gainmodifier"},{"level":3,"title":"gainResource","slug":"gainresource"},{"level":3,"title":"nextAt","slug":"nextat"},{"level":3,"title":"onConvert","slug":"onconvert"},{"level":3,"title":"roundUpCost","slug":"roundupcost"},{"level":3,"title":"scaling","slug":"scaling"},{"level":3,"title":"spend","slug":"spend"}],"relativePath":"api/interfaces/features/conversion.ConversionOptions.md","lastUpdated":null}'),a={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-hidden="true">#</a></h1><p><a href="./../../modules/features/conversion.html">features/conversion</a>.ConversionOptions</p><p>An object that configures a <a href="./../../modules/features/conversion.html#conversion">Conversion</a>.</p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-hidden="true">#</a></h2><h3 id="actualgain" tabindex="-1">actualGain <a class="header-anchor" href="#actualgain" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>actualGain</strong>: <a href="./../../modules/util/computed.html#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity.html#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.html#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-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L31" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:31</a></p><hr><h3 id="baseresource" tabindex="-1">baseResource <a class="header-anchor" href="#baseresource" aria-hidden="true">#</a></h3><p>\u2022 <strong>baseResource</strong>: <a href="./resources/resource.Resource"><code>Resource</code></a><<a href="./../../modules/lib/break_eternity.html#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-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L46" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:46</a></p><hr><h3 id="buymax" tabindex="-1">buyMax <a class="header-anchor" href="#buymax" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>buyMax</strong>: <a href="./../../modules/util/computed.html#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-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L55" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:55</a></p><hr><h3 id="convert" tabindex="-1">convert <a class="header-anchor" href="#convert" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>convert</strong>: <code>VoidFunction</code></p><p>The function that performs the actual conversion from <a href="./conversion.ConversionOptions.html#baseresource">baseResource</a> to <a href="./conversion.ConversionOptions.html#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-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L64" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:64</a></p><hr><h3 id="costmodifier" tabindex="-1">costModifier <a class="header-anchor" href="#costmodifier" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>costModifier</strong>: <a href="./../../modules/util/common.html#withrequired"><code>WithRequired</code></a><<a href="../game/modifiers.Modifier"><code>Modifier</code></a>, <code>"revert"</code>></p><p>A modifier that will be applied to the cost amounts. That is to say, this modifier will be applied to the amount of baseResource before going into the scaling function. A cost modifier of x0.5 would give gain amounts equal to the player having half the baseResource they actually have. Must be reversible in order to correctly calculate <a href="./conversion.ConversionOptions.html#nextat">nextAt</a>.</p><p><strong><code>See</code></strong></p><p><a href="./../../modules/game/modifiers.html#createsequentialmodifier">createSequentialModifier</a> if you want to apply multiple modifiers.</p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L89" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:89</a></p><hr><h3 id="currentat" tabindex="-1">currentAt <a class="header-anchor" href="#currentat" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>currentAt</strong>: <a href="./../../modules/util/computed.html#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity.html#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.html#currentgain">currentGain</a>. That is, if it went below this value then <a href="./conversion.ConversionOptions.html#currentgain">currentGain</a> would decrease. 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-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L37" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:37</a></p><hr><h3 id="currentgain" tabindex="-1">currentGain <a class="header-anchor" href="#currentgain" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>currentGain</strong>: <a href="./../../modules/util/computed.html#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity.html#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-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L25" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:25</a></p><hr><h3 id="gainmodifier" tabindex="-1">gainModifier <a class="header-anchor" href="#gainmodifier" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>gainModifier</strong>: <a href="./../../modules/util/common.html#withrequired"><code>WithRequired</code></a><<a href="../game/modifiers.Modifier"><code>Modifier</code></a>, <code>"revert"</code>></p><p>An additional modifier that will be applied to the gain amounts. Must be reversible in order to correctly calculate <a href="./conversion.ConversionOptions.html#nextat">nextAt</a>.</p><p><strong><code>See</code></strong></p><p><a href="./../../modules/game/modifiers.html#createsequentialmodifier">createSequentialModifier</a> if you want to apply multiple modifiers.</p><h4 id="defined-in-7" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-7" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L81" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:81</a></p><hr><h3 id="gainresource" tabindex="-1">gainResource <a class="header-anchor" href="#gainresource" aria-hidden="true">#</a></h3><p>\u2022 <strong>gainResource</strong>: <a href="./resources/resource.Resource"><code>Resource</code></a><<a href="./../../modules/lib/break_eternity.html#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-8" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-8" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L50" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:50</a></p><hr><h3 id="nextat" tabindex="-1">nextAt <a class="header-anchor" href="#nextat" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>nextAt</strong>: <a href="./../../modules/util/computed.html#computable"><code>Computable</code></a><<a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a>></p><p>The amount of the input resource required to make <a href="./conversion.ConversionOptions.html#currentgain">currentGain</a> increase. Typically this will be set for you in a conversion constructor.</p><h4 id="defined-in-9" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-9" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L42" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:42</a></p><hr><h3 id="onconvert" tabindex="-1">onConvert <a class="header-anchor" href="#onconvert" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>onConvert</strong>: (<code>amountGained</code>: <a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a>) => <code>void</code></p><h4 id="type-declaration" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration" aria-hidden="true">#</a></h4><p>\u25B8 (<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" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-hidden="true">#</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.html#decimalsource"><code>DecimalSource</code></a></td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-hidden="true">#</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-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L75" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:75</a></p><hr><h3 id="roundupcost" tabindex="-1">roundUpCost <a class="header-anchor" href="#roundupcost" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>roundUpCost</strong>: <a href="./../../modules/util/computed.html#computable"><code>Computable</code></a><<code>boolean</code>></p><p>Whether or not to round up the cost to generate a given amount of the output resource.</p><h4 id="defined-in-11" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-11" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L59" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:59</a></p><hr><h3 id="scaling" tabindex="-1">scaling <a class="header-anchor" href="#scaling" aria-hidden="true">#</a></h3><p>\u2022 <strong>scaling</strong>: <a href="./conversion.ScalingFunction"><code>ScalingFunction</code></a></p><p>The scaling function that is used to determine the rate of conversion from one <a href="./resources/resource.Resource">Resource</a> to the other.</p><h4 id="defined-in-12" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-12" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L20" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:20</a></p><hr><h3 id="spend" tabindex="-1">spend <a class="header-anchor" href="#spend" aria-hidden="true">#</a></h3><p>\u2022 <code>Optional</code> <strong>spend</strong>: (<code>amountGained</code>: <a href="./../../modules/lib/break_eternity.html#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-hidden="true">#</a></h4><p>\u25B8 (<code>amountGained</code>): <code>void</code></p><p>The function that spends the <a href="./conversion.ConversionOptions.html#baseresource">baseResource</a> as part of the conversion. Defaults to setting the <a href="./conversion.ConversionOptions.html#baseresource">baseResource</a> amount to 0.</p><h5 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-hidden="true">#</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.html#decimalsource"><code>DecimalSource</code></a></td></tr></tbody></table><h5 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-hidden="true">#</a></h5><p><code>void</code></p><h4 id="defined-in-13" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-13" aria-hidden="true">#</a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/013092f/src/features/conversion.ts#L69" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:69</a></p>',103),i=[n];function s(c,d,h,u,l,f){return t(),r("div",null,i)}var b=e(a,[["render",s]]);export{m as __pageData,b as default};
|