1 line
6.1 KiB
JavaScript
1 line
6.1 KiB
JavaScript
import{_ as a,c as r,a0 as t,o}from"./chunks/framework.P9qPzDnn.js";const h=JSON.parse('{"title":"Function: createResource()","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/features/resources/resource/functions/createResource.md","filePath":"api/features/resources/resource/functions/createResource.md","lastUpdated":null}'),s={name:"api/features/resources/resource/functions/createResource.md"};function c(i,e,l,n,d,u){return o(),r("div",null,e[0]||(e[0]=[t('<p><a href="./../../../../">Profectus</a> / <a href="./../">features/resources/resource</a> / createResource</p><h1 id="function-createresource" tabindex="-1">Function: createResource() <a class="header-anchor" href="#function-createresource" aria-label="Permalink to "Function: createResource()""></a></h1><h2 id="call-signature" tabindex="-1">Call Signature <a class="header-anchor" href="#call-signature" aria-label="Permalink to "Call Signature""></a></h2><blockquote><p><strong>createResource</strong><<code>T</code>>(<code>defaultValue</code>, <code>displayName</code>?, <code>precision</code>?, <code>small</code>?): <a href="./../interfaces/Resource"><code>Resource</code></a><<code>T</code>> & <a href="./../../../../game/persistence/type-aliases/Persistent"><code>Persistent</code></a><<code>T</code>> & <code>object</code></p></blockquote><p>Creates a resource.</p><h3 id="type-parameters" tabindex="-1">Type Parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to "Type Parameters""></a></h3><p>• <strong>T</strong> <em>extends</em> <a href="./../../../../game/persistence/type-aliases/State"><code>State</code></a></p><h3 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h3><h4 id="defaultvalue" tabindex="-1">defaultValue <a class="header-anchor" href="#defaultvalue" aria-label="Permalink to "defaultValue""></a></h4><p><code>T</code></p><p>The initial value of the resource</p><h4 id="displayname" tabindex="-1">displayName? <a class="header-anchor" href="#displayname" aria-label="Permalink to "displayName?""></a></h4><p><code>string</code></p><p>The human readable name of this resource</p><h4 id="precision" tabindex="-1">precision? <a class="header-anchor" href="#precision" aria-label="Permalink to "precision?""></a></h4><p><code>number</code></p><p>The number of significant digits to display by default</p><h4 id="small" tabindex="-1">small? <a class="header-anchor" href="#small" aria-label="Permalink to "small?""></a></h4><p><code>boolean</code></p><p>Whether or not to display very small values or round to 0, by default</p><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h3><p><a href="./../interfaces/Resource"><code>Resource</code></a><<code>T</code>> & <a href="./../../../../game/persistence/type-aliases/Persistent"><code>Persistent</code></a><<code>T</code>> & <code>object</code></p><h3 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to "Defined in""></a></h3><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/features/resources/resource.ts#L27" target="_blank" rel="noreferrer">profectus/src/features/resources/resource.ts:27</a></p><h2 id="call-signature-1" tabindex="-1">Call Signature <a class="header-anchor" href="#call-signature-1" aria-label="Permalink to "Call Signature""></a></h2><blockquote><p><strong>createResource</strong><<code>T</code>>(<code>defaultValue</code>, <code>displayName</code>?, <code>precision</code>?, <code>small</code>?): <a href="./../interfaces/Resource"><code>Resource</code></a><<code>T</code>></p></blockquote><p>Creates a resource.</p><h3 id="type-parameters-1" tabindex="-1">Type Parameters <a class="header-anchor" href="#type-parameters-1" aria-label="Permalink to "Type Parameters""></a></h3><p>• <strong>T</strong> <em>extends</em> <a href="./../../../../game/persistence/type-aliases/State"><code>State</code></a></p><h3 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h3><h4 id="defaultvalue-1" tabindex="-1">defaultValue <a class="header-anchor" href="#defaultvalue-1" aria-label="Permalink to "defaultValue""></a></h4><p><a href="https://vuejs.org/guide/typescript/composition-api.html#typing-ref" target="_blank" rel="noreferrer"><code>Ref</code></a><<code>T</code>, <code>T</code>></p><p>The initial value of the resource</p><h4 id="displayname-1" tabindex="-1">displayName? <a class="header-anchor" href="#displayname-1" aria-label="Permalink to "displayName?""></a></h4><p><code>string</code></p><p>The human readable name of this resource</p><h4 id="precision-1" tabindex="-1">precision? <a class="header-anchor" href="#precision-1" aria-label="Permalink to "precision?""></a></h4><p><code>number</code></p><p>The number of significant digits to display by default</p><h4 id="small-1" tabindex="-1">small? <a class="header-anchor" href="#small-1" aria-label="Permalink to "small?""></a></h4><p><code>boolean</code></p><p>Whether or not to display very small values or round to 0, by default</p><h3 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h3><p><a href="./../interfaces/Resource"><code>Resource</code></a><<code>T</code>></p><h3 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to "Defined in""></a></h3><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/features/resources/resource.ts#L33" target="_blank" rel="noreferrer">profectus/src/features/resources/resource.ts:33</a></p>',46)]))}const f=a(s,[["render",c]]);export{h as __pageData,f as default};
|