1 line
23 KiB
JavaScript
1 line
23 KiB
JavaScript
import{_ as e,c as t,o as r,N as a}from"./chunks/framework.0799945b.js";const b=JSON.parse('{"title":"Module: features/trees/tree","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/trees/tree.md","lastUpdated":null}'),o={name:"api/modules/features/trees/tree.md"},d=a('<h1 id="module-features-trees-tree" tabindex="-1">Module: features/trees/tree <a class="header-anchor" href="#module-features-trees-tree" aria-label="Permalink to "Module: features/trees/tree""></a></h1><h2 id="components" tabindex="-1">Components <a class="header-anchor" href="#components" aria-label="Permalink to "Components""></a></h2><ul><li><a href="./TreeComponent">Tree</a></li><li><a href="./TreeNodeComponent">TreeNode</a></li></ul><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><ul><li><a href="../../../interfaces/features/trees/tree.BaseTree">BaseTree</a></li><li><a href="../../../interfaces/features/trees/tree.BaseTreeNode">BaseTreeNode</a></li><li><a href="../../../interfaces/features/trees/tree.TreeBranch">TreeBranch</a></li><li><a href="../../../interfaces/features/trees/tree.TreeNodeOptions">TreeNodeOptions</a></li><li><a href="../../../interfaces/features/trees/tree.TreeOptions">TreeOptions</a></li></ul><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="generictree" tabindex="-1">GenericTree <a class="header-anchor" href="#generictree" aria-label="Permalink to "GenericTree""></a></h3><p>Ƭ <strong>GenericTree</strong>: <a href="./../feature#replace"><code>Replace</code></a><<a href="./tree#tree"><code>Tree</code></a><<a href="../../../interfaces/features/trees/tree.TreeOptions"><code>TreeOptions</code></a>>, { <code>visibility</code>: <a href="./../../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<a href="../../../enums/features/feature.Visibility"><code>Visibility</code></a> | <code>boolean</code>> }></p><p>A type that matches any valid <a href="./tree#tree">Tree</a> object.</p><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/70cda5f/src/features/trees/tree.ts#L231" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:231</a></p><hr><h3 id="generictreenode" tabindex="-1">GenericTreeNode <a class="header-anchor" href="#generictreenode" aria-label="Permalink to "GenericTreeNode""></a></h3><p>Ƭ <strong>GenericTreeNode</strong>: <a href="./../feature#replace"><code>Replace</code></a><<a href="./tree#treenode"><code>TreeNode</code></a><<a href="../../../interfaces/features/trees/tree.TreeNodeOptions"><code>TreeNodeOptions</code></a>>, { <code>canClick</code>: <a href="./../../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<code>boolean</code>> ; <code>visibility</code>: <a href="./../../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<a href="../../../enums/features/feature.Visibility"><code>Visibility</code></a> | <code>boolean</code>> }></p><p>A type that matches any valid <a href="./tree#treenode">TreeNode</a> object.</p><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/70cda5f/src/features/trees/tree.ts#L91" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:91</a></p><hr><h3 id="resetpropagation" tabindex="-1">ResetPropagation <a class="header-anchor" href="#resetpropagation" aria-label="Permalink to "ResetPropagation""></a></h3><p>Ƭ <strong>ResetPropagation</strong>: (<code>tree</code>: <a href="./tree#generictree"><code>GenericTree</code></a>, <code>resettingNode</code>: <a href="./tree#generictreenode"><code>GenericTreeNode</code></a>) => <code>void</code></p><h4 id="type-declaration" tabindex="-1">Type declaration <a class="header-anchor" href="#type-declaration" aria-label="Permalink to "Type declaration""></a></h4><p>▸ (<code>tree</code>, <code>resettingNode</code>): <code>void</code></p><p>A function that is used to propagate resets through a tree.</p><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></tr></thead><tbody><tr><td style="text-align:left;"><code>tree</code></td><td style="text-align:left;"><a href="./tree#generictree"><code>GenericTree</code></a></td></tr><tr><td style="text-align:left;"><code>resettingNode</code></td><td style="text-align:left;"><a href="./tree#generictreenode"><code>GenericTreeNode</code></a></td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h5><p><code>void</code></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/70cda5f/src/features/trees/tree.ts#L285" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:285</a></p><hr><h3 id="tree" tabindex="-1">Tree <a class="header-anchor" href="#tree" aria-label="Permalink to "Tree""></a></h3><p>Ƭ <strong>Tree</strong><<code>T</code>>: <a href="./../feature#replace"><code>Replace</code></a><<code>T</code> & <a href="../../../interfaces/features/trees/tree.BaseTree"><code>BaseTree</code></a>, { <code>branches</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"branches"</code>]> ; <code>leftSideNodes</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"leftSideNodes"</code>]> ; <code>nodes</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"nodes"</code>]> ; <code>rightSideNodes</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"rightSideNodes"</code>]> ; <code>visibility</code>: <a href="./../../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"visibility"</code>], <a href="./../../../enums/features/feature.Visibility#visible"><code>Visible</code></a>> }></p><p>An object that represents a feature that is a tree of nodes with branches between them. Contains support for reset mechanics that can propagate through the tree.</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="../../../interfaces/features/trees/tree.TreeOptions"><code>TreeOptions</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/70cda5f/src/features/trees/tree.ts#L219" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:219</a></p><hr><h3 id="treenode" tabindex="-1">TreeNode <a class="header-anchor" href="#treenode" aria-label="Permalink to "TreeNode""></a></h3><p>Ƭ <strong>TreeNode</strong><<code>T</code>>: <a href="./../feature#replace"><code>Replace</code></a><<code>T</code> & <a href="../../../interfaces/features/trees/tree.BaseTreeNode"><code>BaseTreeNode</code></a>, { <code>canClick</code>: <a href="./../../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"canClick"</code>], <code>true</code>> ; <code>classes</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"classes"</code>]> ; <code>color</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"color"</code>]> ; <code>display</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"display"</code>]> ; <code>glowColor</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"glowColor"</code>]> ; <code>mark</code>: <a href="./../../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"mark"</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="./../../../enums/features/feature.Visibility#visible"><code>Visible</code></a>> }></p><p>An object that represents a node on a tree.</p><h4 id="type-parameters-1" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-1" 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="../../../interfaces/features/trees/tree.TreeNodeOptions"><code>TreeNodeOptions</code></a></td></tr></tbody></table><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/70cda5f/src/features/trees/tree.ts#L76" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:76</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="treenodetype" tabindex="-1">TreeNodeType <a class="header-anchor" href="#treenodetype" aria-label="Permalink to "TreeNodeType""></a></h3><p>• <code>Const</code> <strong>TreeNodeType</strong>: typeof <a href="./tree#treenodetype"><code>TreeNodeType</code></a></p><p>A symbol used to identify <a href="./tree#treenode">TreeNode</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/70cda5f/src/features/trees/tree.ts#L29" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:29</a></p><hr><h3 id="treetype" tabindex="-1">TreeType <a class="header-anchor" href="#treetype" aria-label="Permalink to "TreeType""></a></h3><p>• <code>Const</code> <strong>TreeType</strong>: typeof <a href="./tree#treetype"><code>TreeType</code></a></p><p>A symbol used to identify <a href="./tree#tree">Tree</a> features.</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/70cda5f/src/features/trees/tree.ts#L31" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:31</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="branchedresetpropagation" tabindex="-1">branchedResetPropagation <a class="header-anchor" href="#branchedresetpropagation" aria-label="Permalink to "branchedResetPropagation""></a></h3><p>▸ <strong>branchedResetPropagation</strong>(<code>tree</code>, <code>resettingNode</code>): <code>void</code></p><p>Propagate resets down the branches of the tree.</p><h4 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "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>tree</code></td><td style="text-align:left;"><a href="./tree#generictree"><code>GenericTree</code></a></td></tr><tr><td style="text-align:left;"><code>resettingNode</code></td><td style="text-align:left;"><a href="./tree#generictreenode"><code>GenericTreeNode</code></a></td></tr></tbody></table><h4 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h4><p><code>void</code></p><h4 id="defined-in-7" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-7" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/trees/tree.ts#L314" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:314</a></p><hr><h3 id="createresourcetooltip" tabindex="-1">createResourceTooltip <a class="header-anchor" href="#createresourcetooltip" aria-label="Permalink to "createResourceTooltip""></a></h3><p>▸ <strong>createResourceTooltip</strong>(<code>resource</code>, <code>requiredResource?</code>, <code>requirement?</code>): <code>Ref</code><<code>string</code>></p><p>Utility for creating a tooltip for a tree node that displays a resource-based unlock requirement, and after unlock shows the amount of another resource. It sounds oddly specific, but comes up a lot.</p><h4 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h4><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Default value</th></tr></thead><tbody><tr><td style="text-align:left;"><code>resource</code></td><td style="text-align:left;"><a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a><<a href="./../../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></td><td style="text-align:left;"><code>undefined</code></td></tr><tr><td style="text-align:left;"><code>requiredResource</code></td><td style="text-align:left;"><code>null</code> | <a href="../../../interfaces/features/resources/resource.Resource"><code>Resource</code></a><<a href="./../../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></td><td style="text-align:left;"><code>null</code></td></tr><tr><td style="text-align:left;"><code>requirement</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;"><code>0</code></td></tr></tbody></table><h4 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h4><p><code>Ref</code><<code>string</code>></p><h4 id="defined-in-8" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-8" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/trees/tree.ts#L353" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:353</a></p><hr><h3 id="createtree" tabindex="-1">createTree <a class="header-anchor" href="#createtree" aria-label="Permalink to "createTree""></a></h3><p>▸ <strong>createTree</strong><<code>T</code>>(<code>optionsFunc</code>): <a href="./tree#tree"><code>Tree</code></a><<code>T</code>></p><p>Lazily creates a tree with the given options.</p><h4 id="type-parameters-2" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-2" 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="../../../interfaces/features/trees/tree.TreeOptions"><code>TreeOptions</code></a></td></tr></tbody></table><h4 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to "Parameters""></a></h4><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="../../../interfaces/features/trees/tree.BaseTree"><code>BaseTree</code></a>, <a href="./tree#generictree"><code>GenericTree</code></a>></td><td style="text-align:left;">Tree options.</td></tr></tbody></table><h4 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to "Returns""></a></h4><p><a href="./tree#tree"><code>Tree</code></a><<code>T</code>></p><h4 id="defined-in-9" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-9" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/trees/tree.ts#L242" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:242</a></p><hr><h3 id="createtreenode" tabindex="-1">createTreeNode <a class="header-anchor" href="#createtreenode" aria-label="Permalink to "createTreeNode""></a></h3><p>▸ <strong>createTreeNode</strong><<code>T</code>>(<code>optionsFunc?</code>): <a href="./tree#treenode"><code>TreeNode</code></a><<code>T</code>></p><p>Lazily creates a tree node with the given options.</p><h4 id="type-parameters-3" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-3" 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="../../../interfaces/features/trees/tree.TreeNodeOptions"><code>TreeNodeOptions</code></a></td></tr></tbody></table><h4 id="parameters-4" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-4" aria-label="Permalink to "Parameters""></a></h4><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="../../../interfaces/features/trees/tree.BaseTreeNode"><code>BaseTreeNode</code></a>, <a href="./tree#generictreenode"><code>GenericTreeNode</code></a>></td><td style="text-align:left;">Tree Node options.</td></tr></tbody></table><h4 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to "Returns""></a></h4><p><a href="./tree#treenode"><code>TreeNode</code></a><<code>T</code>></p><h4 id="defined-in-10" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-10" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/trees/tree.ts#L103" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:103</a></p><hr><h3 id="defaultresetpropagation" tabindex="-1">defaultResetPropagation <a class="header-anchor" href="#defaultresetpropagation" aria-label="Permalink to "defaultResetPropagation""></a></h3><p>▸ <strong>defaultResetPropagation</strong>(<code>tree</code>, <code>resettingNode</code>): <code>void</code></p><p>Propagate resets down the tree by resetting every node in a lower row.</p><h4 id="parameters-5" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-5" aria-label="Permalink to "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>tree</code></td><td style="text-align:left;"><a href="./tree#generictree"><code>GenericTree</code></a></td></tr><tr><td style="text-align:left;"><code>resettingNode</code></td><td style="text-align:left;"><a href="./tree#generictreenode"><code>GenericTreeNode</code></a></td></tr></tbody></table><h4 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to "Returns""></a></h4><p><code>void</code></p><h4 id="defined-in-11" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-11" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/trees/tree.ts#L290" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:290</a></p><hr><h3 id="invertedresetpropagation" tabindex="-1">invertedResetPropagation <a class="header-anchor" href="#invertedresetpropagation" aria-label="Permalink to "invertedResetPropagation""></a></h3><p>▸ <strong>invertedResetPropagation</strong>(<code>tree</code>, <code>resettingNode</code>): <code>void</code></p><p>Propagate resets down the tree by resetting every node in a lower row.</p><h4 id="parameters-6" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-6" aria-label="Permalink to "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>tree</code></td><td style="text-align:left;"><a href="./tree#generictree"><code>GenericTree</code></a></td></tr><tr><td style="text-align:left;"><code>resettingNode</code></td><td style="text-align:left;"><a href="./tree#generictreenode"><code>GenericTreeNode</code></a></td></tr></tbody></table><h4 id="returns-6" tabindex="-1">Returns <a class="header-anchor" href="#returns-6" aria-label="Permalink to "Returns""></a></h4><p><code>void</code></p><h4 id="defined-in-12" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-12" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/70cda5f/src/features/trees/tree.ts#L302" target="_blank" rel="noreferrer">profectus/src/features/trees/tree.ts:302</a></p>',121),c=[d];function s(i,n,l,h,f,u){return r(),t("div",null,c)}const g=e(o,[["render",s]]);export{b as __pageData,g as default};
|