profectus-docs/assets/api_modules_features_repeatable.md.3d77d9ba.js

1 line
17 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 e,c as t,o as a,N as o}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/repeatable","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/repeatable.md","lastUpdated":null}'),l={name:"api/modules/features/repeatable.md"},r=o('<h1 id="module-features-repeatable" tabindex="-1">Module: features/repeatable <a class="header-anchor" href="#module-features-repeatable" aria-label="Permalink to &quot;Module: features/repeatable&quot;"></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to &quot;Interfaces&quot;"></a></h2><h3 id="baserepeatable" tabindex="-1">BaseRepeatable <a class="header-anchor" href="#baserepeatable" aria-label="Permalink to &quot;BaseRepeatable&quot;"></a></h3><p>• <strong>BaseRepeatable</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./repeatable#repeatableoptions">RepeatableOptions</a> to create a <a href="./repeatable#repeatable">Repeatable</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>[Component]</code></td><td style="text-align:left;"><a href="./feature#genericcomponent"><code>GenericComponent</code></a></td><td style="text-align:left;">The Vue component used to render this feature.</td></tr><tr><td style="text-align:left;"><code>[GatherProps]</code></td><td style="text-align:left;">() =&gt; <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a>&lt;<code>string</code>, <code>unknown</code>&gt;</td><td style="text-align:left;">A function to gather the props the vue component requires for this feature.</td></tr><tr><td style="text-align:left;"><code>amount</code></td><td style="text-align:left;"><a href="./../game/persistence#persistent"><code>Persistent</code></a>&lt;<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>&gt;</td><td style="text-align:left;">The current amount this repeatable has.</td></tr><tr><td style="text-align:left;"><code>amountToIncrease</code></td><td style="text-align:left;"><code>Ref</code>&lt;<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>&gt;</td><td style="text-align:left;">How much amount can be increased by, or 1 if unclickable. Capped at 1 if <a href="./repeatable#maximize">maximize</a> is false.</td></tr><tr><td style="text-align:left;"><code>canClick</code></td><td style="text-align:left;"><a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">Whether or not this repeatable can be clicked.</td></tr><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 features that appear in the DOM. Will not persist between refreshes or updates.</td></tr><tr><td style="text-align:left;"><code>maxed</code></td><td style="text-align:left;"><code>Ref</code>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">Whether or not this repeatable&#39;s amount is at it&#39;s limit.</td></tr><tr><td style="text-align:left;"><code>onClick</code></td><td style="text-align:left;">(<code>event?</code>: <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent" target="_blank" rel="noreferrer"><code>MouseEvent</code></a> | <a href="https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent" target="_blank" rel="noreferrer"><code>TouchEvent</code></a>) =&gt; <code>void</code></td><td style="text-align:left;">A function that gets called when this repeatable is clicked.</td></tr><tr><td style="text-align:left;"><code>type</code></td><td style="text-align:left;">typeof <a href="./repeatable#repeatabletype"><code>RepeatableType</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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c386ace/src/features/repeatable.tsx#L78" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:78</a></p><hr><h3 id="repeatableoptions" tabindex="-1">RepeatableOptions <a class="header-anchor" href="#repeatableoptions" aria-label="Permalink to &quot;RepeatableOptions&quot;"></a></h3><p>• <strong>RepeatableOptions</strong>: <code>Object</code></p><p>An object that configures a <a href="./repeatable#repeatable">Repeatable</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>classes?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a>&lt;<code>string</code>, <code>boolean</code>&gt;&gt;</td><td style="text-align:left;">Dictionary of CSS classes to apply to this feature.</td></tr><tr><td style="text-align:left;"><code>display?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<a href="./repeatable#repeatabledisplay"><code>RepeatableDisplay</code></a>&gt;</td><td style="text-align:left;">The display to use for this repeatable.</td></tr><tr><td style="text-align:left;"><code>initialAmount?</code></td><td style="text-align:left;"><a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a></td><td style="text-align:left;">The initial amount this repeatable has on a new save / after reset.</td></tr><tr><td style="text-align:left;"><code>limit?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>&gt;</td><td style="text-align:left;">The maximum amount obtainable for this repeatable.</td></tr><tr><td style="text-align:left;"><code>mark?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<code>string</code> | <code>boolean</code>&gt;</td><td style="text-align:left;">Shows a marker on the corner of the feature.</td></tr><tr><td style="text-align:left;"><code>maximize?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">Whether or not clicking this repeatable should attempt to maximize amount based on the requirements met. Requires <a href="./repeatable#requirements">requirements</a> to be a requirement or array of requirements with Requirement.canMaximize true.</td></tr><tr><td style="text-align:left;"><code>requirements</code></td><td style="text-align:left;"><a href="./../game/requirements#requirements"><code>Requirements</code></a></td><td style="text-align:left;">The requirement(s) to increase this repeatable.</td></tr><tr><td style="text-align:left;"><code>small?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">Toggles a smaller design for the feature.</td></tr><tr><td style="text-align:left;"><code>style?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<a href="./feature#stylevalue"><code>StyleValue</code></a>&gt;</td><td style="text-align:left;">CSS to apply to this feature.</td></tr><tr><td style="text-align:left;"><code>visibility?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a>&lt;<code>boolean</code> | <a href="./feature#visibility"><code>Visibility</code></a>&gt;</td><td style="text-align:left;">Whether this repeatable should be visible.</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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c386ace/src/features/repeatable.tsx#L52" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:52</a></p><h2 id="type-aliases" tabindex="-1">Type Aliases <a class="header-anchor" href="#type-aliases" aria-label="Permalink to &quot;Type Aliases&quot;"></a></h2><h3 id="genericrepeatable" tabindex="-1">GenericRepeatable <a class="header-anchor" href="#genericrepeatable" aria-label="Permalink to &quot;GenericRepeatable&quot;"></a></h3><p>Ƭ <strong>GenericRepeatable</strong>: <a href="./feature#replace"><code>Replace</code></a>&lt;<a href="./repeatable#repeatable"><code>Repeatable</code></a>&lt;<a href="./repeatable#repeatableoptions"><code>RepeatableOptions</code></a>&gt;, { <code>limit</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a>&lt;<a href="./../util/bignum#decimalsource"><code>DecimalSource</code></a>&gt; ; <code>visibility</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a>&lt;<a href="./feature#visibility"><code>Visibility</code></a> | <code>boolean</code>&gt; }&gt;</p><p>A type that matches any valid <a href="./repeatable#repeatable">Repeatable</a> object.</p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c386ace/src/features/repeatable.tsx#L119" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:119</a></p><hr><h3 id="repeatable" tabindex="-1">Repeatable <a class="header-anchor" href="#repeatable" aria-label="Permalink to &quot;Repeatable&quot;"></a></h3><p>Ƭ <strong>Repeatable</strong>&lt;<code>T</code>&gt;: <a href="./feature#replace"><code>Replace</code></a>&lt;<code>T</code> &amp; <a href="./repeatable#baserepeatable"><code>BaseRepeatable</code></a>, { <code>classes</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;classes&quot;</code>]&gt; ; <code>display</code>: <code>Ref</code>&lt;<a href="./feature#coercablecomponent"><code>CoercableComponent</code></a>&gt; ; <code>limit</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;limit&quot;</code>], <a href="./../lib/break_eternity#default"><code>default</code></a>&gt; ; <code>mark</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;mark&quot;</code>]&gt; ; <code>maximize</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;maximize&quot;</code>]&gt; ; <code>requirements</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;requirements&quot;</code>]&gt; ; <code>small</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;small&quot;</code>]&gt; ; <code>style</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<code>T</code>[<code>&quot;style&quot;</code>]&gt; ; <code>visibility</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a>&lt;<code>T</code>[<code>&quot;visibility&quot;</code>], <a href="./feature#visible"><code>Visible</code></a>&gt; }&gt;</p><p>An object that represents a feature with multiple &quot;levels&quot; with scaling requirements.</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="./repeatable#repeatableoptions"><code>RepeatableOptions</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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c386ace/src/features/repeatable.tsx#L103" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:103</a></p><hr><h3 id="repeatabledisplay" tabindex="-1">RepeatableDisplay <a class="header-anchor" href="#repeatabledisplay" aria-label="Permalink to &quot;RepeatableDisplay&quot;"></a></h3><p>Ƭ <strong>RepeatableDisplay</strong>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> | { <code>description?</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> ; <code>effectDisplay?</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> ; <code>showAmount?</code>: <code>boolean</code> ; <code>title?</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> }</p><p>A type that can be used to customize the <a href="./repeatable#repeatable">Repeatable</a> display.</p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c386ace/src/features/repeatable.tsx#L38" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:38</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to &quot;Variables&quot;"></a></h2><h3 id="repeatabletype" tabindex="-1">RepeatableType <a class="header-anchor" href="#repeatabletype" aria-label="Permalink to &quot;RepeatableType&quot;"></a></h3><p>• <code>Const</code> <strong>RepeatableType</strong>: typeof <a href="./repeatable#repeatabletype"><code>RepeatableType</code></a></p><p>A symbol used to identify <a href="./repeatable#repeatable">Repeatable</a> features.</p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c386ace/src/features/repeatable.tsx#L35" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:35</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to &quot;Functions&quot;"></a></h2><h3 id="createrepeatable" tabindex="-1">createRepeatable <a class="header-anchor" href="#createrepeatable" aria-label="Permalink to &quot;createRepeatable&quot;"></a></h3><p>▸ <strong>createRepeatable</strong>&lt;<code>T</code>&gt;(<code>optionsFunc</code>): <a href="./repeatable#repeatable"><code>Repeatable</code></a>&lt;<code>T</code>&gt;</p><p>Lazily creates a repeatable 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 &quot;Type parameters&quot;"></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="./repeatable#repeatableoptions"><code>RepeatableOptions</code></a></td></tr></tbody></table><h5 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></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>&lt;<code>T</code>, <a href="./repeatable#baserepeatable"><code>BaseRepeatable</code></a>, <a href="./repeatable#genericrepeatable"><code>GenericRepeatable</code></a>&gt;</td><td style="text-align:left;">Repeatable options.</td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h5><p><a href="./repeatable#repeatable"><code>Repeatable</code></a>&lt;<code>T</code>&gt;</p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c386ace/src/features/repeatable.tsx#L131" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:131</a></p>',53),d=[r];function c(i,s,n,p,b,f){return a(),t("div",null,d)}const m=e(l,[["render",c]]);export{u as __pageData,m as default};