profectus-docs/assets/api_interfaces_features_conversion.ScalingFunction.md.2faa9291.js

1 line
7.4 KiB
JavaScript

import{_ as e,c as r,o as t,a}from"./app.ab34650d.js";const m=JSON.parse('{"title":"Interface: ScalingFunction","description":"","frontmatter":{"editLink":false},"headers":[{"level":2,"title":"Properties","slug":"properties"},{"level":3,"title":"currentAt","slug":"currentat"},{"level":3,"title":"currentGain","slug":"currentgain"},{"level":3,"title":"nextAt","slug":"nextat"}],"relativePath":"api/interfaces/features/conversion.ScalingFunction.md","lastUpdated":null}'),n={name:"api/interfaces/features/conversion.ScalingFunction.md"},o=a('<h1 id="interface-scalingfunction" tabindex="-1">Interface: ScalingFunction <a class="header-anchor" href="#interface-scalingfunction" aria-hidden="true">#</a></h1><p><a href="./../../modules/features/conversion.html">features/conversion</a>.ScalingFunction</p><p>A collection of functions that allow a conversion to scale the amount of resources gained based on the input resource. This typically shouldn&#39;t be created directly. Instead use one of the scaling function constructors.</p><p><strong><code>See</code></strong></p><ul><li><a href="./../../modules/features/conversion.html#createlinearscaling">createLinearScaling</a>.</li><li><a href="./../../modules/features/conversion.html#createpolynomialscaling">createPolynomialScaling</a>.</li></ul><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-hidden="true">#</a></h2><h3 id="currentat" tabindex="-1">currentAt <a class="header-anchor" href="#currentat" aria-hidden="true">#</a></h3><p>\u2022 <strong>currentAt</strong>: (<code>conversion</code>: <a href="./../../modules/features/conversion.html#genericconversion"><code>GenericConversion</code></a>) =&gt; <a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></p><h4 id="type-declaration" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration" aria-hidden="true">#</a></h4><p>\u25B8 (<code>conversion</code>): <a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></p><p>Calculates the amount of the input resource that is required for the current value of <code>conversion.currentGain</code>. Note that <code>conversion.currentGain</code> has been modified by <code>conversion.gainModifier</code>, so you will need to revert that as appropriate. The conversion is responsible for rounding up the amount as appropriate. The returned value should not be below 0.</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>conversion</code></td><td style="text-align:left;"><a href="./../../modules/features/conversion.html#genericconversion"><code>GenericConversion</code></a></td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-hidden="true">#</a></h5><p><a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></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#L227" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:227</a></p><hr><h3 id="currentgain" tabindex="-1">currentGain <a class="header-anchor" href="#currentgain" aria-hidden="true">#</a></h3><p>\u2022 <strong>currentGain</strong>: (<code>conversion</code>: <a href="./../../modules/features/conversion.html#genericconversion"><code>GenericConversion</code></a>) =&gt; <a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></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>conversion</code>): <a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></p><p>Calculates the amount of the output resource a conversion should be able to currently produce. This should be based off of <code>conversion.baseResource.value</code>. The conversion is responsible for applying the gainModifier, so this function should be un-modified. It does not need to be clamped or rounded.</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>conversion</code></td><td style="text-align:left;"><a href="./../../modules/features/conversion.html#genericconversion"><code>GenericConversion</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><a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></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#L220" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:220</a></p><hr><h3 id="nextat" tabindex="-1">nextAt <a class="header-anchor" href="#nextat" aria-hidden="true">#</a></h3><p>\u2022 <strong>nextAt</strong>: (<code>conversion</code>: <a href="./../../modules/features/conversion.html#genericconversion"><code>GenericConversion</code></a>) =&gt; <a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></p><h4 id="type-declaration-2" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration-2" aria-hidden="true">#</a></h4><p>\u25B8 (<code>conversion</code>): <a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></p><p>Calculates the amount of the input resource that would be required for the current value of <code>conversion.currentGain</code> to increase. Note that <code>conversion.currentGain</code> has been modified by <code>conversion.gainModifier</code>, so you will need to revert that as appropriate. The conversion is responsible for rounding up the amount as appropriate. The returned value should not be below 0.</p><h5 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" 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>conversion</code></td><td style="text-align:left;"><a href="./../../modules/features/conversion.html#genericconversion"><code>GenericConversion</code></a></td></tr></tbody></table><h5 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-hidden="true">#</a></h5><p><a href="./../../modules/lib/break_eternity.html#decimalsource"><code>DecimalSource</code></a></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#L234" target="_blank" rel="noopener noreferrer">profectus/src/features/conversion.ts:234</a></p>',41),i=[o];function c(s,d,l,h,u,f){return t(),r("div",null,i)}var b=e(n,[["render",c]]);export{m as __pageData,b as default};