Files
ueblueprint/js/entity/ObjectReferenceEntity.js
2023-04-01 19:40:34 +02:00

33 lines
675 B
JavaScript
Executable File

import IEntity from "./IEntity.js"
export default class ObjectReferenceEntity extends IEntity {
static attributes = {
type: {
default: "",
},
path: {
default: "",
},
}
static {
this.cleanupAttributes(this.attributes)
}
constructor(values = {}) {
if (values.constructor === String) {
values = {
path: values
}
}
super(values)
/** @type {String} */ this.type
/** @type {String} */ this.path
}
getName() {
return this.path.match(/[^\.\/]+$/)?.[0] ?? ""
}
}