1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
import{_ as e,c as t,o as a,N as r}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Module: features/reset","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/reset.md","lastUpdated":null}'),s={name:"api/modules/features/reset.md"},o=r('<h1 id="module-features-reset" tabindex="-1">Module: features/reset <a class="header-anchor" href="#module-features-reset" aria-label="Permalink to "Module: features/reset""></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><h3 id="basereset" tabindex="-1">BaseReset <a class="header-anchor" href="#basereset" aria-label="Permalink to "BaseReset""></a></h3><p>• <strong>BaseReset</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./reset#resetoptions">ResetOptions</a> to create an <a href="./reset#reset">Reset</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>id</code></td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">An auto-generated ID for identifying which reset is being performed. Will not persist between refreshes or updates.</td></tr><tr><td style="text-align:left;"><code>reset</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">Trigger the reset.</td></tr><tr><td style="text-align:left;"><code>type</code></td><td style="text-align:left;">typeof <a href="./reset#resettype"><code>ResetType</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 "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/reset.ts#L30" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:30</a></p><hr><h3 id="resetoptions" tabindex="-1">ResetOptions <a class="header-anchor" href="#resetoptions" aria-label="Permalink to "ResetOptions""></a></h3><p>• <strong>ResetOptions</strong>: <code>Object</code></p><p>An object that configures a Clickable.</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>onReset?</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">A function that is called when the reset is performed.</td></tr><tr><td style="text-align:left;"><code>thingsToReset</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <code>unknown</code>>[]></td><td style="text-align:left;">List of things to reset. Can include objects which will be recursed over for persistent values.</td></tr></tbody></table><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/reset.ts#L20" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:20</a></p><h2 id="type-aliases" tabindex="-1">Type Aliases <a class="header-anchor" href="#type-aliases" aria-label="Permalink to "Type Aliases""></a></h2><h3 id="genericreset" tabindex="-1">GenericReset <a class="header-anchor" href="#genericreset" aria-label="Permalink to "GenericReset""></a></h3><p>Ƭ <strong>GenericReset</strong>: <a href="./reset#reset"><code>Reset</code></a><<a href="./reset#resetoptions"><code>ResetOptions</code></a>></p><p>A type that matches any valid <a href="./reset#reset">Reset</a> object.</p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/reset.ts#L48" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:48</a></p><hr><h3 id="reset" tabindex="-1">Reset <a class="header-anchor" href="#reset" aria-label="Permalink to "Reset""></a></h3><p>Ƭ <strong>Reset</strong><<code>T</code>>: <a href="./feature#replace"><code>Replace</code></a><<code>T</code> & <a href="./reset#basereset"><code>BaseReset</code></a>, { <code>thingsToReset</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"thingsToReset"</code>]> }></p><p>An object that represents a reset mechanic, which resets progress back to its initial state.</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="./reset#resetoptions"><code>ResetOptions</code></a></td></tr></tbody></table><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/reset.ts#L40" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:40</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="resettype" tabindex="-1">ResetType <a class="header-anchor" href="#resettype" aria-label="Permalink to "ResetType""></a></h3><p>• <code>Const</code> <strong>ResetType</strong>: typeof <a href="./reset#resettype"><code>ResetType</code></a></p><p>A symbol used to identify <a href="./reset#reset">Reset</a> features.</p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/reset.ts#L15" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:15</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="createreset" tabindex="-1">createReset <a class="header-anchor" href="#createreset" aria-label="Permalink to "createReset""></a></h3><p>▸ <strong>createReset</strong><<code>T</code>>(<code>optionsFunc</code>): <a href="./reset#reset"><code>Reset</code></a><<code>T</code>></p><p>Lazily creates a reset with the given options.</p><h5 id="type-parameters-1" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-1" aria-label="Permalink to "Type parameters""></a></h5><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="./reset#resetoptions"><code>ResetOptions</code></a></td></tr></tbody></table><h5 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h5><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>optionsFunc</code></td><td style="text-align:left;"><a href="./feature#optionsfunc"><code>OptionsFunc</code></a><<code>T</code>, <a href="./reset#basereset"><code>BaseReset</code></a>, <a href="./reset#genericreset"><code>GenericReset</code></a>></td><td style="text-align:left;">Reset options.</td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h5><p><a href="./reset#reset"><code>Reset</code></a><<code>T</code>></p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/reset.ts#L54" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:54</a></p><hr><h3 id="trackresettime" tabindex="-1">trackResetTime <a class="header-anchor" href="#trackresettime" aria-label="Permalink to "trackResetTime""></a></h3><p>▸ <strong>trackResetTime</strong>(<code>layer</code>, <code>reset</code>): <a href="./../game/persistence#persistent"><code>Persistent</code></a><<a href="./../lib/break_eternity#default"><code>default</code></a>></p><p>Track the time since the specified reset last occured.</p><h5 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h5><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>layer</code></td><td style="text-align:left;"><a href="./../game/layers#baselayer"><code>BaseLayer</code></a></td><td style="text-align:left;">The layer the reset is attached to</td></tr><tr><td style="text-align:left;"><code>reset</code></td><td style="text-align:left;"><a href="./reset#genericreset"><code>GenericReset</code></a></td><td style="text-align:left;">The reset mechanic to track the time since</td></tr></tbody></table><h5 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h5><p><a href="./../game/persistence#persistent"><code>Persistent</code></a><<a href="./../lib/break_eternity#default"><code>default</code></a>></p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/reset.ts#L92" target="_blank" rel="noreferrer">profectus/src/features/reset.ts:92</a></p>',57),d=[o];function i(n,l,c,h,f,p){return a(),t("div",null,d)}const g=e(s,[["render",i]]);export{b as __pageData,g as default};
|