CustomProperties creating fixed

This commit is contained in:
barsdeveloper
2024-06-05 16:30:14 +02:00
parent beccfe522a
commit 6d99db5fd1
5 changed files with 11 additions and 29 deletions

19
dist/ueblueprint.js vendored
View File

@@ -4920,7 +4920,6 @@ class PinTypeEntity extends IEntity {
PinSubCategory: StringEntity.withDefault(), PinSubCategory: StringEntity.withDefault(),
PinSubCategoryObject: ObjectReferenceEntity.withDefault(), PinSubCategoryObject: ObjectReferenceEntity.withDefault(),
PinSubCategoryMemberReference: FunctionReferenceEntity.withDefault(), PinSubCategoryMemberReference: FunctionReferenceEntity.withDefault(),
PinValueType: PinTypeEntity.withDefault(),
ContainerType: SymbolEntity, ContainerType: SymbolEntity,
bIsReference: BooleanEntity.withDefault(), bIsReference: BooleanEntity.withDefault(),
bIsConst: BooleanEntity.withDefault(), bIsConst: BooleanEntity.withDefault(),
@@ -4936,7 +4935,6 @@ class PinTypeEntity extends IEntity {
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategory>} */ this.PinSubCategory; /** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategory>} */ this.PinSubCategory;
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryObject>} */ this.PinSubCategoryObject; /** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryObject>} */ this.PinSubCategoryObject;
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryMemberReference>} */ this.PinSubCategoryMemberReference; /** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryMemberReference>} */ this.PinSubCategoryMemberReference;
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinValueType>} */ this.PinValueType;
/** @type {InstanceType<typeof PinTypeEntity.attributes.ContainerType>} */ this.ContainerType; /** @type {InstanceType<typeof PinTypeEntity.attributes.ContainerType>} */ this.ContainerType;
/** @type {InstanceType<typeof PinTypeEntity.attributes.bIsReference>} */ this.bIsReference; /** @type {InstanceType<typeof PinTypeEntity.attributes.bIsReference>} */ this.bIsReference;
/** @type {InstanceType<typeof PinTypeEntity.attributes.bIsConst>} */ this.bIsConst; /** @type {InstanceType<typeof PinTypeEntity.attributes.bIsConst>} */ this.bIsConst;
@@ -5378,17 +5376,7 @@ class PinEntity extends IEntity {
/** @param {PinEntity} other */ /** @param {PinEntity} other */
copyTypeFrom(other) { copyTypeFrom(other) {
this.PinType.PinCategory = other.PinType.PinCategory; this.PinType = other.PinType;
this.PinType.PinSubCategory = other.PinType.PinSubCategory;
this.PinType.PinSubCategoryObject = other.PinType.PinSubCategoryObject;
this.PinType.PinSubCategoryMemberReference = other.PinType.PinSubCategoryMemberReference;
this.PinType.PinValueType = other.PinType.PinValueType;
this.PinType.ContainerType = other.PinType.ContainerType;
this.PinType.bIsReference = other.PinType.bIsReference;
this.PinType.bIsConst = other.PinType.bIsConst;
this.PinType.bIsWeakPointer = other.PinType.bIsWeakPointer;
this.PinType.bIsUObjectWrapper = other.PinType.bIsUObjectWrapper;
this.PinType.bSerializeAsSinglePrecisionFloat = other.PinType.bSerializeAsSinglePrecisionFloat;
} }
getDefaultValue(maybeCreate = false) { getDefaultValue(maybeCreate = false) {
@@ -5859,7 +5847,9 @@ class ObjectEntity extends IEntity {
Parsernostrum.reg(/CustomProperties\s+/), Parsernostrum.reg(/CustomProperties\s+/),
this.attributes.CustomProperties.type.grammar, this.attributes.CustomProperties.type.grammar,
).map(([_0, pin]) => values => { ).map(([_0, pin]) => values => {
(values.CustomProperties ??= []).push(pin); /** @type {InstanceType<typeof this.attributes.CustomProperties>} */(
values.CustomProperties ??= new (this.attributes.CustomProperties)()
).values.push(pin);
}) })
static inlinedArrayEntryGrammar = Parsernostrum.seq( static inlinedArrayEntryGrammar = Parsernostrum.seq(
Parsernostrum.alt( Parsernostrum.alt(
@@ -5913,6 +5903,7 @@ class ObjectEntity extends IEntity {
attributes.forEach(attributeSetter => attributeSetter(values)); attributes.forEach(attributeSetter => attributeSetter(values));
return new this(values) return new this(values)
}) })
.label("ObjectEntity")
static grammarMultipleObjects = Parsernostrum.seq( static grammarMultipleObjects = Parsernostrum.seq(
Parsernostrum.whitespaceOpt, Parsernostrum.whitespaceOpt,
this.grammar, this.grammar,

File diff suppressed because one or more lines are too long

View File

@@ -137,7 +137,9 @@ export default class ObjectEntity extends IEntity {
P.reg(/CustomProperties\s+/), P.reg(/CustomProperties\s+/),
this.attributes.CustomProperties.type.grammar, this.attributes.CustomProperties.type.grammar,
).map(([_0, pin]) => values => { ).map(([_0, pin]) => values => {
(values.CustomProperties ??= []).push(pin) /** @type {InstanceType<typeof this.attributes.CustomProperties>} */(
values.CustomProperties ??= new (this.attributes.CustomProperties)()
).values.push(pin)
}) })
static inlinedArrayEntryGrammar = P.seq( static inlinedArrayEntryGrammar = P.seq(
P.alt( P.alt(
@@ -191,6 +193,7 @@ export default class ObjectEntity extends IEntity {
attributes.forEach(attributeSetter => attributeSetter(values)) attributes.forEach(attributeSetter => attributeSetter(values))
return new this(values) return new this(values)
}) })
.label("ObjectEntity")
static grammarMultipleObjects = P.seq( static grammarMultipleObjects = P.seq(
P.whitespaceOpt, P.whitespaceOpt,
this.grammar, this.grammar,

View File

@@ -212,17 +212,7 @@ export default class PinEntity extends IEntity {
/** @param {PinEntity} other */ /** @param {PinEntity} other */
copyTypeFrom(other) { copyTypeFrom(other) {
this.PinType.PinCategory = other.PinType.PinCategory this.PinType = other.PinType
this.PinType.PinSubCategory = other.PinType.PinSubCategory
this.PinType.PinSubCategoryObject = other.PinType.PinSubCategoryObject
this.PinType.PinSubCategoryMemberReference = other.PinType.PinSubCategoryMemberReference
this.PinType.PinValueType = other.PinType.PinValueType
this.PinType.ContainerType = other.PinType.ContainerType
this.PinType.bIsReference = other.PinType.bIsReference
this.PinType.bIsConst = other.PinType.bIsConst
this.PinType.bIsWeakPointer = other.PinType.bIsWeakPointer
this.PinType.bIsUObjectWrapper = other.PinType.bIsUObjectWrapper
this.PinType.bSerializeAsSinglePrecisionFloat = other.PinType.bSerializeAsSinglePrecisionFloat
} }
getDefaultValue(maybeCreate = false) { getDefaultValue(maybeCreate = false) {

View File

@@ -14,7 +14,6 @@ export default class PinTypeEntity extends IEntity {
PinSubCategory: StringEntity.withDefault(), PinSubCategory: StringEntity.withDefault(),
PinSubCategoryObject: ObjectReferenceEntity.withDefault(), PinSubCategoryObject: ObjectReferenceEntity.withDefault(),
PinSubCategoryMemberReference: FunctionReferenceEntity.withDefault(), PinSubCategoryMemberReference: FunctionReferenceEntity.withDefault(),
PinValueType: PinTypeEntity.withDefault(),
ContainerType: SymbolEntity, ContainerType: SymbolEntity,
bIsReference: BooleanEntity.withDefault(), bIsReference: BooleanEntity.withDefault(),
bIsConst: BooleanEntity.withDefault(), bIsConst: BooleanEntity.withDefault(),
@@ -30,7 +29,6 @@ export default class PinTypeEntity extends IEntity {
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategory>} */ this.PinSubCategory /** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategory>} */ this.PinSubCategory
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryObject>} */ this.PinSubCategoryObject /** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryObject>} */ this.PinSubCategoryObject
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryMemberReference>} */ this.PinSubCategoryMemberReference /** @type {InstanceType<typeof PinTypeEntity.attributes.PinSubCategoryMemberReference>} */ this.PinSubCategoryMemberReference
/** @type {InstanceType<typeof PinTypeEntity.attributes.PinValueType>} */ this.PinValueType
/** @type {InstanceType<typeof PinTypeEntity.attributes.ContainerType>} */ this.ContainerType /** @type {InstanceType<typeof PinTypeEntity.attributes.ContainerType>} */ this.ContainerType
/** @type {InstanceType<typeof PinTypeEntity.attributes.bIsReference>} */ this.bIsReference /** @type {InstanceType<typeof PinTypeEntity.attributes.bIsReference>} */ this.bIsReference
/** @type {InstanceType<typeof PinTypeEntity.attributes.bIsConst>} */ this.bIsConst /** @type {InstanceType<typeof PinTypeEntity.attributes.bIsConst>} */ this.bIsConst