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('
Ƭ GenericTree: Replace
<Tree
<TreeOptions
>, { visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid Tree object.
profectus/src/features/trees/tree.ts:231
Ƭ GenericTreeNode: Replace
<TreeNode
<TreeNodeOptions
>, { canClick
: ProcessedComputable
<boolean
> ; visibility
: ProcessedComputable
<Visibility
| boolean
> }>
A type that matches any valid TreeNode object.
profectus/src/features/trees/tree.ts:91
Ƭ ResetPropagation: (tree
: GenericTree
, resettingNode
: GenericTreeNode
) => void
▸ (tree
, resettingNode
): void
A function that is used to propagate resets through a tree.
Name | Type |
---|---|
tree | GenericTree |
resettingNode | GenericTreeNode |
void
profectus/src/features/trees/tree.ts:285
Ƭ Tree<T
>: Replace
<T
& BaseTree
, { branches
: GetComputableType
<T
["branches"
]> ; leftSideNodes
: GetComputableType
<T
["leftSideNodes"
]> ; nodes
: GetComputableType
<T
["nodes"
]> ; rightSideNodes
: GetComputableType
<T
["rightSideNodes"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
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.
Name | Type |
---|---|
T | extends TreeOptions |
profectus/src/features/trees/tree.ts:219
Ƭ TreeNode<T
>: Replace
<T
& BaseTreeNode
, { canClick
: GetComputableTypeWithDefault
<T
["canClick"
], true
> ; classes
: GetComputableType
<T
["classes"
]> ; color
: GetComputableType
<T
["color"
]> ; display
: GetComputableType
<T
["display"
]> ; glowColor
: GetComputableType
<T
["glowColor"
]> ; mark
: GetComputableType
<T
["mark"
]> ; style
: GetComputableType
<T
["style"
]> ; visibility
: GetComputableTypeWithDefault
<T
["visibility"
], Visible
> }>
An object that represents a node on a tree.
Name | Type |
---|---|
T | extends TreeNodeOptions |
profectus/src/features/trees/tree.ts:76
• Const
TreeNodeType: typeof TreeNodeType
A symbol used to identify TreeNode features.
profectus/src/features/trees/tree.ts:29
• Const
TreeType: typeof TreeType
A symbol used to identify Tree features.
profectus/src/features/trees/tree.ts:31
▸ branchedResetPropagation(tree
, resettingNode
): void
Propagate resets down the branches of the tree.
Name | Type |
---|---|
tree | GenericTree |
resettingNode | GenericTreeNode |
void
profectus/src/features/trees/tree.ts:314
▸ createResourceTooltip(resource
, requiredResource?
, requirement?
): Ref
<string
>
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.
Name | Type | Default value |
---|---|---|
resource | Resource <DecimalSource > | undefined |
requiredResource | null | Resource <DecimalSource > | null |
requirement | Computable <DecimalSource > | 0 |
Ref
<string
>
profectus/src/features/trees/tree.ts:353
▸ createTree<T
>(optionsFunc
): Tree
<T
>
Lazily creates a tree with the given options.
Name | Type |
---|---|
T | extends TreeOptions |
Name | Type | Description |
---|---|---|
optionsFunc | OptionsFunc <T , BaseTree , GenericTree > | Tree options. |
Tree
<T
>
profectus/src/features/trees/tree.ts:242
▸ createTreeNode<T
>(optionsFunc?
): TreeNode
<T
>
Lazily creates a tree node with the given options.
Name | Type |
---|---|
T | extends TreeNodeOptions |
Name | Type | Description |
---|---|---|
optionsFunc? | OptionsFunc <T , BaseTreeNode , GenericTreeNode > | Tree Node options. |
TreeNode
<T
>
profectus/src/features/trees/tree.ts:103
▸ defaultResetPropagation(tree
, resettingNode
): void
Propagate resets down the tree by resetting every node in a lower row.
Name | Type |
---|---|
tree | GenericTree |
resettingNode | GenericTreeNode |
void
profectus/src/features/trees/tree.ts:290
▸ invertedResetPropagation(tree
, resettingNode
): void
Propagate resets down the tree by resetting every node in a lower row.
Name | Type |
---|---|
tree | GenericTree |
resettingNode | GenericTreeNode |
void