mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:08:18 +08:00
35 lines
1.0 KiB
JavaScript
Executable File
35 lines
1.0 KiB
JavaScript
Executable File
import Parsernostrum from "parsernostrum"
|
|
import GuidEntity from "./GuidEntity.js"
|
|
import IEntity from "./IEntity.js"
|
|
import PathSymbolEntity from "./PathSymbolEntity.js"
|
|
import AttributeInfo from "./AttributeInfo.js"
|
|
|
|
export default class PinReferenceEntity extends IEntity {
|
|
|
|
static attributes = {
|
|
...super.attributes,
|
|
objectName: AttributeInfo.createType(PathSymbolEntity),
|
|
pinGuid: AttributeInfo.createType(GuidEntity),
|
|
}
|
|
static grammar = this.createGrammar()
|
|
|
|
static createGrammar() {
|
|
return Parsernostrum.seq(
|
|
PathSymbolEntity.createGrammar(),
|
|
Parsernostrum.whitespace,
|
|
GuidEntity.createGrammar()
|
|
).map(
|
|
([objectName, _1, pinGuid]) => new this({
|
|
objectName: objectName,
|
|
pinGuid: pinGuid,
|
|
})
|
|
)
|
|
}
|
|
|
|
constructor(values) {
|
|
super(values)
|
|
/** @type {PathSymbolEntity} */ this.objectName
|
|
/** @type {GuidEntity} */ this.pinGuid
|
|
}
|
|
}
|