2 lines
96 KiB
JavaScript
2 lines
96 KiB
JavaScript
|
import{_ as e,c as o,o as t,N as c}from"./chunks/framework.0799945b.js";const h=JSON.parse('{"title":"Module: game/formulas/formulas","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/game/formulas/formulas.md","lastUpdated":null}'),d={name:"api/modules/game/formulas/formulas.md"},r=c('<h1 id="module-game-formulas-formulas" tabindex="-1">Module: game/formulas/formulas <a class="header-anchor" href="#module-game-formulas-formulas" aria-label="Permalink to "Module: game/formulas/formulas""></a></h1><h2 id="classes" tabindex="-1">Classes <a class="header-anchor" href="#classes" aria-label="Permalink to "Classes""></a></h2><h3 id="default" tabindex="-1">default <a class="header-anchor" href="#default" aria-label="Permalink to "default""></a></h3><p>• <strong>default</strong><<code>T</code>>: <code>Object</code></p><p>A class that can be used for cost/goal functions. It can be evaluated similar to a cost function, but also provides extra features for supported formulas. For example, a lot of math functions can be inverted. Typically, the use of these extra features is to support cost/goal functions that have multiple levels purchased/completed at once efficiently.</p><p><strong><code>See</code></strong></p><ul><li><a href="./formulas#calculatemaxaffordable">calculateMaxAffordable</a></li><li><a href="./../requirements#createcostrequirement">createCostRequirement</a></li></ul><h4 id="type-parameters" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to "Type parameters""></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="./types#formulasource"><code>FormulaSource</code></a>] | <a href="./types#formulasource"><code>FormulaSource</code></a>[]</td></tr></tbody></table><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>constructor</code></td><td style="text-align:left;"><T>(<code>options</code>: <a href="./types#formulaoptions"><code>FormulaOptions</code></a><<code>T</code>>) => <a href="./formulas#default"><code>default</code></a><<code>T</code>></td></tr><tr><td style="text-align:left;"><code>applySubstitution</code></td><td style="text-align:left;"><code>undefined</code> | <a href="./types#substitutionfunction"><code>SubstitutionFunction</code></a><<code>T</code>></td></tr><tr><td style="text-align:left;"><code>divide</code></td><td style="text-align:left;"><T>(<code>this</code>: <code>T</code>, <code>value</code>: <a href="./types#formulasource"><code>FormulaSource</code></a>) => <code>T</code><T>(<code>this</code>: <a href="./types#genericformula"><code>GenericFormula</code></a>, <code>value</code>: <code>T</code>) => <code>T</code>(<code>this</code>: <a href="./types#genericformula"><code>GenericFormula</code></a>, <code>value</code>: <a href="./types#formulasource"><code>FormulaSource</code></a>) => <a href="./types#genericformula"><code>GenericFormula</code></a></td></tr><tr><td style="text-align:left;"><code>divideBy</code></td><td style="text-align:left;"><T>(<code>this</code>: <code>T</code>, <code>value</code>: <a href="./types#formulasource"><code>FormulaSource</code></a>) => <code>T</code><T>(<code>this</code>: <a href="./types#genericformula"><code>GenericFormula</code></a>, <code>value</code>: <code>T</code>) => <code>T</code>(<code>this</code>: <a href="./types#genericformula"><code>GenericFormula</code></a>, <code>value</code>: <a href="./types#formulasource"><code>FormulaSource</code></a>) => <a href="./types#genericformula"><code>GenericFormula</code></a></td></tr><tr><td style="text-align:left;"><code>dividedBy</code></td><td style="text-align:left;"><T>(<code>this</code>: <code>T</code>, <code>value</code>: <a href=".
|