profectus-docs/assets/api_features_resources_resource_functions_createResource.md.V1nYHp16.js

1 line
6.1 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 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 &quot;Function: createResource()&quot;"></a></h1><h2 id="call-signature" tabindex="-1">Call Signature <a class="header-anchor" href="#call-signature" aria-label="Permalink to &quot;Call Signature&quot;"></a></h2><blockquote><p><strong>createResource</strong>&lt;<code>T</code>&gt;(<code>defaultValue</code>, <code>displayName</code>?, <code>precision</code>?, <code>small</code>?): <a href="./../interfaces/Resource"><code>Resource</code></a>&lt;<code>T</code>&gt; &amp; <a href="./../../../../game/persistence/type-aliases/Persistent"><code>Persistent</code></a>&lt;<code>T</code>&gt; &amp; <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 &quot;Type Parameters&quot;"></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 &quot;Parameters&quot;"></a></h3><h4 id="defaultvalue" tabindex="-1">defaultValue <a class="header-anchor" href="#defaultvalue" aria-label="Permalink to &quot;defaultValue&quot;"></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 &quot;displayName?&quot;"></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 &quot;precision?&quot;"></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 &quot;small?&quot;"></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 &quot;Returns&quot;"></a></h3><p><a href="./../interfaces/Resource"><code>Resource</code></a>&lt;<code>T</code>&gt; &amp; <a href="./../../../../game/persistence/type-aliases/Persistent"><code>Persistent</code></a>&lt;<code>T</code>&gt; &amp; <code>object</code></p><h3 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to &quot;Defined in&quot;"></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 &quot;Call Signature&quot;"></a></h2><blockquote><p><strong>createResource</strong>&lt;<code>T</code>&gt;(<code>defaultValue</code>, <code>displayName</code>?, <code>precision</code>?, <code>small</code>?): <a href="./../interfaces/Resource"><code>Resource</code></a>&lt;<code>T</code>&gt;</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 &quot;Type Parameters&quot;"></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 &quot;Parameters&quot;"></a></h3><h4 id="defaultvalue-1" tabindex="-1">defaultValue <a class="header-anchor" href="#defaultvalue-1" aria-label="Permalink to &quot;defaultValue&quot;"></a></h4><p><a href="https://vuejs.org/guide/typescript/composition-api.html#typing-ref" target="_blank" rel="noreferrer"><code>Ref</code></a>&lt;<code>T</code>, <code>T</code>&gt;</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 &quot;displayName?&quot;"></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 &quot;precision?&quot;"></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 &quot;small?&quot;"></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 &quot;Returns&quot;"></a></h3><p><a href="./../interfaces/Resource"><code>Resource</code></a>&lt;<code>T</code>&gt;</p><h3 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></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};