profectus-docs/assets/api_modules_features_upgrades_upgrade.md.98e1167c.js

1 line
10 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as e,c as a,o as t,N as r}from"./chunks/framework.0799945b.js";const f=JSON.parse('{"title":"Module: features/upgrades/upgrade","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/upgrades/upgrade.md","lastUpdated":null}'),d={name:"api/modules/features/upgrades/upgrade.md"},o=r('<h1 id="module-features-upgrades-upgrade" tabindex="-1">Module: features/upgrades/upgrade <a class="header-anchor" href="#module-features-upgrades-upgrade" aria-label="Permalink to &quot;Module: features/upgrades/upgrade&quot;"></a></h1><h2 id="components" tabindex="-1">Components <a class="header-anchor" href="#components" aria-label="Permalink to &quot;Components&quot;"></a></h2><ul><li><a href="./UpgradeComponent">Upgrade</a></li></ul><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/upgrades/upgrade.BaseUpgrade">BaseUpgrade</a></li><li><a href="../../../interfaces/features/upgrades/upgrade.UpgradeOptions">UpgradeOptions</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="genericupgrade" tabindex="-1">GenericUpgrade <a class="header-anchor" href="#genericupgrade" aria-label="Permalink to &quot;GenericUpgrade&quot;"></a></h3><p>Ƭ <strong>GenericUpgrade</strong>: <a href="./../feature#replace"><code>Replace</code></a>&lt;<a href="./upgrade#upgrade"><code>Upgrade</code></a>&lt;<a href="../../../interfaces/features/upgrades/upgrade.UpgradeOptions"><code>UpgradeOptions</code></a>&gt;, { <code>visibility</code>: <a href="./../../util/computed#processedcomputable"><code>ProcessedComputable</code></a>&lt;<a href="../../../enums/features/feature.Visibility"><code>Visibility</code></a> | <code>boolean</code>&gt; }&gt;</p><p>A type that matches any valid <a href="./upgrade#upgrade">Upgrade</a> object.</p><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/70cda5f/src/features/upgrades/upgrade.ts#L106" target="_blank" rel="noreferrer">profectus/src/features/upgrades/upgrade.ts:106</a></p><hr><h3 id="upgrade" tabindex="-1">Upgrade <a class="header-anchor" href="#upgrade" aria-label="Permalink to &quot;Upgrade&quot;"></a></h3><p>Ƭ <strong>Upgrade</strong>&lt;<code>T</code>&gt;: <a href="./../feature#replace"><code>Replace</code></a>&lt;<code>T</code> &amp; <a href="../../../interfaces/features/upgrades/upgrade.BaseUpgrade"><code>BaseUpgrade</code></a>, { <code>classes</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;classes&quot;</code>]&gt; ; <code>display</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;display&quot;</code>]&gt; ; <code>mark</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;mark&quot;</code>]&gt; ; <code>requirements</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;requirements&quot;</code>]&gt; ; <code>style</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;style&quot;</code>]&gt; ; <code>visibility</code>: <a href="./../../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;visibility&quot;</code>], <a href="./../../../enums/features/feature.Visibility#visible"><code>Visible</code></a>&gt; }&gt;</p><p>An object that represents a feature that can be purchased a single time.</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/upgrades/upgrade.UpgradeOptions"><code>UpgradeOptions</code></a></td></tr></tbody></table><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/upgrades/upgrade.ts#L93" target="_blank" rel="noreferrer">profectus/src/features/upgrades/upgrade.ts:93</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to &quot;Variables&quot;"></a></h2><h3 id="upgradetype" tabindex="-1">UpgradeType <a class="header-anchor" href="#upgradetype" aria-label="Permalink to &quot;UpgradeType&quot;"></a></h3><p>• <code>Const</code> <strong>UpgradeType</strong>: typeof <a href="./upgrade#upgradetype"><code>UpgradeType</code></a></p><p>A symbol used to identify <a href="./upgrade#upgrade">Upgrade</a> features.</p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/upgrades/upgrade.ts#L40" target="_blank" rel="noreferrer">profectus/src/features/upgrades/upgrade.ts:40</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to &quot;Functions&quot;"></a></h2><h3 id="createupgrade" tabindex="-1">createUpgrade <a class="header-anchor" href="#createupgrade" aria-label="Permalink to &quot;createUpgrade&quot;"></a></h3><p>▸ <strong>createUpgrade</strong>&lt;<code>T</code>&gt;(<code>optionsFunc</code>): <a href="./upgrade#upgrade"><code>Upgrade</code></a>&lt;<code>T</code>&gt;</p><p>Lazily creates an upgrade with the given options.</p><h4 id="type-parameters-1" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-1" 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/upgrades/upgrade.UpgradeOptions"><code>UpgradeOptions</code></a></td></tr></tbody></table><h4 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>optionsFunc</code></td><td style="text-align:left;"><a href="./../feature#optionsfunc"><code>OptionsFunc</code></a>&lt;<code>T</code>, <a href="../../../interfaces/features/upgrades/upgrade.BaseUpgrade"><code>BaseUpgrade</code></a>, <a href="./upgrade#genericupgrade"><code>GenericUpgrade</code></a>&gt;</td><td style="text-align:left;">Upgrade options.</td></tr></tbody></table><h4 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><a href="./upgrade#upgrade"><code>Upgrade</code></a>&lt;<code>T</code>&gt;</p><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/upgrades/upgrade.ts#L117" target="_blank" rel="noreferrer">profectus/src/features/upgrades/upgrade.ts:117</a></p><hr><h3 id="setupautopurchase" tabindex="-1">setupAutoPurchase <a class="header-anchor" href="#setupautopurchase" aria-label="Permalink to &quot;setupAutoPurchase&quot;"></a></h3><p>▸ <strong>setupAutoPurchase</strong>(<code>layer</code>, <code>autoActive</code>, <code>upgrades?</code>): <code>void</code></p><p>Utility to auto purchase a list of upgrades whenever they&#39;re affordable.</p><h4 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to &quot;Parameters&quot;"></a></h4><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Default value</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>layer</code></td><td style="text-align:left;"><a href="./../../game/layers#genericlayer"><code>GenericLayer</code></a></td><td style="text-align:left;"><code>undefined</code></td><td style="text-align:left;">The layer the upgrades are apart of</td></tr><tr><td style="text-align:left;"><code>autoActive</code></td><td style="text-align:left;"><a href="./../../util/computed#computable"><code>Computable</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;"><code>undefined</code></td><td style="text-align:left;">Whether or not the upgrades should currently be auto-purchasing</td></tr><tr><td style="text-align:left;"><code>upgrades</code></td><td style="text-align:left;"><a href="./upgrade#genericupgrade"><code>GenericUpgrade</code></a>[]</td><td style="text-align:left;"><code>[]</code></td><td style="text-align:left;">The specific upgrades to upgrade. If unspecified, uses all upgrades on the layer.</td></tr></tbody></table><h4 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to &quot;Returns&quot;"></a></h4><p><code>void</code></p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/upgrades/upgrade.ts#L190" target="_blank" rel="noreferrer">profectus/src/features/upgrades/upgrade.ts:190</a></p>',47),s=[o];function l(c,i,p,u,n,h){return t(),a("div",null,s)}const b=e(d,[["render",l]]);export{f as __pageData,b as default};