mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
34 lines
1.2 KiB
JavaScript
Executable File
34 lines
1.2 KiB
JavaScript
Executable File
import P from "parsernostrum"
|
|
import Grammar from "../serialization/Grammar.js"
|
|
import GuidEntity from "./GuidEntity.js"
|
|
import IEntity from "./IEntity.js"
|
|
import ObjectReferenceEntity from "./ObjectReferenceEntity.js"
|
|
|
|
export default class MacroGraphReferenceEntity extends IEntity {
|
|
|
|
static attributes = {
|
|
...super.attributes,
|
|
MacroGraph: ObjectReferenceEntity,
|
|
GraphBlueprint: ObjectReferenceEntity,
|
|
GraphGuid: GuidEntity,
|
|
}
|
|
static grammar = this.createGrammar()
|
|
|
|
constructor(values) {
|
|
super(values)
|
|
/** @type {InstanceType<typeof MacroGraphReferenceEntity.attributes.MacroGraph>} */ this.MacroGraph
|
|
/** @type {InstanceType<typeof MacroGraphReferenceEntity.attributes.GraphBlueprint>} */ this.GraphBlueprint
|
|
/** @type {InstanceType<typeof MacroGraphReferenceEntity.attributes.GraphGuid>} */ this.GraphGuid
|
|
}
|
|
|
|
/** @returns {P<MacroGraphReferenceEntity>} */
|
|
static createGrammar() {
|
|
return Grammar.createEntityGrammar(this)
|
|
}
|
|
|
|
getMacroName() {
|
|
const colonIndex = this.MacroGraph.path.search(":")
|
|
return this.MacroGraph.path.substring(colonIndex + 1)
|
|
}
|
|
}
|