profectus-docs/assets/api_modules_features_upgrade.md.1354b683.js

2 lines
18 KiB
JavaScript
Raw Normal View History

import{_ as e,c as t,o as a,N as d}from"./chunks/framework.0799945b.js";const f=JSON.parse('{"title":"Module: features/upgrades/upgrade","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/upgrade.md","lastUpdated":null}'),r={name:"api/modules/features/upgrade.md"},o=d('<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="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to &quot;Interfaces&quot;"></a></h2><h3 id="baseupgrade" tabindex="-1">BaseUpgrade <a class="header-anchor" href="#baseupgrade" aria-label="Permalink to &quot;BaseUpgrade&quot;"></a></h3><p> <strong>BaseUpgrade</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./upgrade#upgradeoptions">UpgradeOptions</a> to create an <a href="./upgrade#upgrade">Upgrade</a>.</p><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>[Component]</code></td><td style="text-align:left;"><a href="./feature#genericcomponent"><code>GenericComponent</code></a></td><td style="text-align:left;">The Vue component used to render this feature.</td></tr><tr><td style="text-align:left;"><code>[GatherProps]</code></td><td style="text-align:left;">() =&gt; <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a>&lt;<code>string</code>, <code>unknown</code>&gt;</td><td style="text-align:left;">A function to gather the props the vue component requires for this feature.</td></tr><tr><td style="text-align:left;"><code>bought</code></td><td style="text-align:left;"><a href="./../game/persistence#persistent"><code>Persistent</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">Whether or not this upgrade has been purchased.</td></tr><tr><td style="text-align:left;"><code>canPurchase</code></td><td style="text-align:left;"><code>Ref</code>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">Whether or not the upgrade can currently be purchased.</td></tr><tr><td style="text-align:left;"><code>id</code></td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates.</td></tr><tr><td style="text-align:left;"><code>purchase</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">Purchase the upgrade</td></tr><tr><td style="text-align:left;"><code>type</code></td><td style="text-align:left;">typeof <a href="./upgrade#upgradetype"><code>UpgradeType</code></a></td><td style="text-align:left;">A symbol that helps identify features of the same type.</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/upgrades/upgrade.ts#L75" target="_blank" rel="noreferrer">profectus/src/features/upgrades/upgrade.ts:75</a></p><hr><h3 id="upgradeoptions" tabindex="-1">UpgradeOptions <a class="header-anchor" href="#upgradeoptions" aria-label="Permalink to &quot;UpgradeOptions&quot;"></a></h3><p> <strong>UpgradeOptions</strong>: <code>Object</code></p><p>An object that configures a <a href="./upgrade#upgrade">Upgrade</a>.</p><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>classes?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<a