mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
29 lines
600 B
JavaScript
Executable File
29 lines
600 B
JavaScript
Executable File
import IEntity from "./IEntity"
|
|
|
|
export default class ObjectReferenceEntity extends IEntity {
|
|
|
|
static attributes = {
|
|
type: "",
|
|
path: "",
|
|
}
|
|
|
|
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] ?? ""
|
|
}
|
|
}
|