1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
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 "Module: features/repeatable""></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><h3 id="baserepeatable" tabindex="-1">BaseRepeatable <a class="header-anchor" href="#baserepeatable" aria-label="Permalink to "BaseRepeatable""></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;">() => <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;">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><<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></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><<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></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><<code>boolean</code>></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><<code>boolean</code>></td><td style="text-align:left;">Whether or not this repeatable's amount is at it'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>) => <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 "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b5e7e77/src/features/repeatable.tsx#L79" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:79</a></p><hr><h3 id="repeatableoptions" tabindex="-1">RepeatableOptions <a class="header-anchor" href="#repeatableoptions" aria-label="Permalink to "RepeatableOptions""></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><<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>boolean</code>>></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><<a href="./repeatable#repeatabledisplay"><code>RepeatableDisplay</code></a>></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><<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></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><<code>string</code> | <code>boolean</code>></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><<code>boolean</code>></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><<code>boolean</code>></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><<a href="./feature#stylevalue"><code>StyleValue</code></a>></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><<code>boolean</code> | <a href="./feature#visibility"><code>Visibility</code></a>></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 "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b5e7e77/src/features/repeatable.tsx#L53" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:53</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="genericrepeatable" tabindex="-1">GenericRepeatable <a class="header-anchor" href="#genericrepeatable" aria-label="Permalink to "GenericRepeatable""></a></h3><p>Ƭ <strong>GenericRepeatable</strong>: <a href="./feature#replace"><code>Replace</code></a><<a href="./repeatable#repeatable"><code>Repeatable</code></a><<a href="./repeatable#repeatableoptions"><code>RepeatableOptions</code></a>>, { <code>limit</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<a href="./../util/bignum#decimalsource"><code>DecimalSource</code></a>> ; <code>visibility</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<a href="./feature#visibility"><code>Visibility</code></a> | <code>boolean</code>> }></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 "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b5e7e77/src/features/repeatable.tsx#L120" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:120</a></p><hr><h3 id="repeatable" tabindex="-1">Repeatable <a class="header-anchor" href="#repeatable" aria-label="Permalink to "Repeatable""></a></h3><p>Ƭ <strong>Repeatable</strong><<code>T</code>>: <a href="./feature#replace"><code>Replace</code></a><<code>T</code> & <a href="./repeatable#baserepeatable"><code>BaseRepeatable</code></a>, { <code>classes</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"classes"</code>]> ; <code>display</code>: <code>Ref</code><<a href="./feature#coercablecomponent"><code>CoercableComponent</code></a>> ; <code>limit</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"limit"</code>], <a href="./../lib/break_eternity#default"><code>default</code></a>> ; <code>mark</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"mark"</code>]> ; <code>maximize</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"maximize"</code>]> ; <code>requirements</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"requirements"</code>]> ; <code>small</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"small"</code>]> ; <code>style</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"style"</code>]> ; <code>visibility</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"visibility"</code>], <a href="./feature#visible"><code>Visible</code></a>> }></p><p>An object that represents a feature with multiple "levels" with scaling requirements.</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="./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 "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b5e7e77/src/features/repeatable.tsx#L104" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:104</a></p><hr><h3 id="repeatabledisplay" tabindex="-1">RepeatableDisplay <a class="header-anchor" href="#repeatabledisplay" aria-label="Permalink to "RepeatableDisplay""></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 "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b5e7e77/src/features/repeatable.tsx#L39" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:39</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="repeatabletype" tabindex="-1">RepeatableType <a class="header-anchor" href="#repeatabletype" aria-label="Permalink to "RepeatableType""></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 "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b5e7e77/src/features/repeatable.tsx#L36" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:36</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="createrepeatable" tabindex="-1">createRepeatable <a class="header-anchor" href="#createrepeatable" aria-label="Permalink to "createRepeatable""></a></h3><p>▸ <strong>createRepeatable</strong><<code>T</code>>(<code>optionsFunc</code>, <code>...decorators</code>): <a href="./repeatable#repeatable"><code>Repeatable</code></a><<code>T</code>></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 "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="./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 "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="./repeatable#baserepeatable"><code>BaseRepeatable</code></a>, <a href="./repeatable#genericrepeatable"><code>GenericRepeatable</code></a>></td><td style="text-align:left;">Repeatable options.</td></tr><tr><td style="text-align:left;"><code>...decorators</code></td><td style="text-align:left;"><a href="./decorators/common#genericdecorator"><code>GenericDecorator</code></a>[]</td><td style="text-align:left;">-</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="./repeatable#repeatable"><code>Repeatable</code></a><<code>T</code>></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/b5e7e77/src/features/repeatable.tsx#L132" target="_blank" rel="noreferrer">profectus/src/features/repeatable.tsx:132</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};
|