mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-21 13:47:37 +08:00
SVGIcon class, Macro reference entity
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { html } from "lit"
|
||||
import Configuration from "../Configuration"
|
||||
import ElementFactory from "../element/ElementFactory"
|
||||
import KnotPinTemplate from "./KnotPinTemplate"
|
||||
import NodeTemplate from "./NodeTemplate"
|
||||
@@ -10,6 +11,11 @@ import NodeTemplate from "./NodeTemplate"
|
||||
|
||||
export default class KnotNodeTemplate extends NodeTemplate {
|
||||
|
||||
static #traversedPin = new Set()
|
||||
|
||||
/** @type {Boolean?} */
|
||||
#chainDirection = null // The node is part of a chain connected to an input or output pin
|
||||
|
||||
/** @type {PinElement} */
|
||||
#inputPin
|
||||
get inputPin() {
|
||||
@@ -22,6 +28,24 @@ export default class KnotNodeTemplate extends NodeTemplate {
|
||||
return this.#outputPin
|
||||
}
|
||||
|
||||
/** @param {PinElement} startingPin */
|
||||
findDirectionaPin(startingPin) {
|
||||
if (
|
||||
startingPin.nodeElement.getType() !== Configuration.nodeType.knot
|
||||
|| KnotNodeTemplate.#traversedPin.has(startingPin)
|
||||
) {
|
||||
KnotNodeTemplate.#traversedPin.clear()
|
||||
return true
|
||||
}
|
||||
KnotNodeTemplate.#traversedPin.add(startingPin)
|
||||
for (let pin of startingPin.getLinks().map(l => this.element.blueprint.getPin(l))) {
|
||||
if (this.findDirectionaPin(pin)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<div class="ueb-node-border"></div>
|
||||
@@ -60,4 +84,8 @@ export default class KnotNodeTemplate extends NodeTemplate {
|
||||
)),
|
||||
]
|
||||
}
|
||||
|
||||
linksChanged() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user