2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
|
import{_ as e,c as t,o as r,N as a}from"./chunks/framework.0799945b.js";const m=JSON.parse('{"title":"Module: features/resources/resource","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/resources/resource.md","lastUpdated":null}'),o={name:"api/modules/features/resources/resource.md"},s=a('<h1 id="module-features-resources-resource" tabindex="-1">Module: features/resources/resource <a class="header-anchor" href="#module-features-resources-resource" aria-label="Permalink to "Module: features/resources/resource""></a></h1><h2 id="components" tabindex="-1">Components <a class="header-anchor" href="#components" aria-label="Permalink to "Components""></a></h2><ul><li><a href="./MainDisplayComponent">MainDisplay</a></li><li><a href="./ResourceComponent">Resource</a></li></ul><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><ul><li><a href="../../../interfaces/features/resources/resource.Resource">Resource</a></li></ul><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="createresource" tabindex="-1">createResource <a class="header-anchor" href="#createresource" aria-label="Permalink to "createResource""></a></h3><p>▸ <strong>createResource</strong><<code>T</code>>(<code>defaultValue</code>, <code>displayName?</code>, <code>precision?</code>, <code>small?</code>): <a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a><<code>T</code>> & <a href="./../../game/persistence#persistent"><code>Persistent</code></a><<code>T</code>> & { <code>[NonPersistent]</code>: <a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a><<code>T</code>> }</p><p>Creates a resource.</p><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="./../../game/persistence#state"><code>State</code></a></td></tr></tbody></table><h4 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></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>defaultValue</code></td><td style="text-align:left;"><code>T</code></td><td style="text-align:left;">The initial value of the resource</td></tr><tr><td style="text-align:left;"><code>displayName?</code></td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">The human readable name of this resource</td></tr><tr><td style="text-align:left;"><code>precision?</code></td><td style="text-align:left;"><code>number</code></td><td style="text-align:left;">The number of significant digits to display by default</td></tr><tr><td style="text-align:left;"><code>small?</code></td><td style="text-align:left;"><code>boolean</code></td><td style="text-align:left;">Whether or not to display very small values or round to 0, by default</td></tr></tbody></table><h4 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h4><p><a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a><<code>T</code>> & <a href="./../../game/persistence#persistent"><code>Persistent</code></a><<code>T</code>> & { <code>[NonPersistent]</code>: <a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a><<code>T</code>> }</p><h4 id="
|