Started work on serialization, refactoring

This commit is contained in:
barsdeveloper
2021-10-05 17:26:34 +02:00
parent 5032289e86
commit e8d9963a18
10 changed files with 283 additions and 19 deletions

View File

@@ -1,11 +1,10 @@
import UDrag from "./input/UDrag"
import UGraphEntity from "./UGraphEntity"
export default class USelectableDraggable extends HTMLElement {
export default class USelectableDraggable extends UGraphEntity {
constructor() {
super()
/** @type {import("./UEBlueprint").default}" */
this.blueprint = null
this.dragObject = null
this.location = [0, 0]
this.selected = false
@@ -17,7 +16,7 @@ export default class USelectableDraggable extends HTMLElement {
}
connectedCallback() {
this.blueprint = this.closest('u-blueprint')
super.connectedCallback()
this.dragObject = new UDrag(this, null, { // UDrag doesn't need blueprint
looseTarget: true
})