profectus-docs/assets/api_modules_features_resources_resource.md.ec525798.js

2 lines
15 KiB
JavaScript
Raw Normal View History

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 &quot;Module: features/resources/resource&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="./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 &quot;Interfaces&quot;"></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 &quot;Functions&quot;"></a></h2><h3 id="createresource" tabindex="-1">createResource <a class="header-anchor" href="#createresource" aria-label="Permalink to &quot;createResource&quot;"></a></h3><p> <strong>createResource</strong>&lt;<code>T</code>&gt;(<code>defaultValue</code>, <code>displayName?</code>, <code>precision?</code>, <code>small?</code>): <a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a>&lt;<code>T</code>&gt; &amp; <a href="./../../game/persistence#persistent"><code>Persistent</code></a>&lt;<code>T</code>&gt; &amp; { <code>[NonPersistent]</code>: <a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a>&lt;<code>T</code>&gt; }</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 &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="./../../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 &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>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 &quot;Returns&quot;"></a></h4><p><a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a>&lt;<code>T</code>&gt; &amp; <a href="./../../game/persistence#persistent"><code>Persistent</code></a>&lt;<code>T</code>&gt; &amp; { <code>[NonPersistent]</code>: <a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a>&lt;<code>T</code>&gt; }</p><h4 id="