Serialization refactoring to drop suboject logic

This commit is contained in:
barsdeveloper
2023-04-01 15:26:44 +02:00
parent 8c30118a13
commit 82bb9917fb
13 changed files with 316 additions and 292 deletions

View File

@@ -21,6 +21,7 @@ import UnionType from "./UnionType.js"
import Utility from "../Utility.js"
import Vector2DEntity from "./Vector2DEntity.js"
import VectorEntity from "./VectorEntity.js"
import ComputedType from "./ComputedType.js"
/**
* @typedef {import("./IEntity").AnyValue} AnyValue
@@ -52,71 +53,71 @@ export default class PinEntity extends IEntity {
}
static lookbehind = "Pin"
static attributes = {
"PinId": {
PinId: {
type: GuidEntity,
},
"PinName": "",
"PinFriendlyName": {
PinName: "",
PinFriendlyName: {
type: new UnionType(LocalizedTextEntity, FormatTextEntity, String),
showDefault: false,
},
"PinToolTip": {
PinToolTip: {
type: String,
showDefault: false,
},
"Direction": {
Direction: {
type: String,
showDefault: false,
},
"PinType.PinCategory": "",
"PinType.PinSubCategory": "",
"PinType.PinSubCategoryObject": {
PinType$PinCategory: "",
PinType$PinSubCategory: "",
PinType$PinSubCategoryObject: {
type: ObjectReferenceEntity,
},
"PinType.PinSubCategoryMemberReference": {
PinType$PinSubCategoryMemberReference: {
type: FunctionReferenceEntity,
value: null,
},
"PinType.PinValueType": {
PinType$PinValueType: {
type: PinTypeEntity,
value: null,
},
"PinType.ContainerType": {
PinType$ContainerType: {
type: PathSymbolEntity,
},
"PinType.bIsReference": false,
"PinType.bIsConst": false,
"PinType.bIsWeakPointer": false,
"PinType.bIsUObjectWrapper": false,
"PinType.bSerializeAsSinglePrecisionFloat": false,
"LinkedTo": {
PinType$bIsReference: false,
PinType$bIsConst: false,
PinType$bIsWeakPointer: false,
PinType$bIsUObjectWrapper: false,
PinType$bSerializeAsSinglePrecisionFloat: false,
LinkedTo: {
type: [PinReferenceEntity],
showDefault: false,
},
"DefaultValue": {
DefaultValue: {
/** @param {PinEntity} pinEntity */
type: pinEntity => pinEntity.getEntityType(true) ?? String,
type: new ComputedType(pinEntity => pinEntity.getEntityType(true) ?? String),
serialized: true,
showDefault: false,
},
"AutogeneratedDefaultValue": {
AutogeneratedDefaultValue: {
type: String,
showDefault: false,
},
"DefaultObject": {
DefaultObject: {
type: ObjectReferenceEntity,
showDefault: false,
value: null,
},
"PersistentGuid": {
PersistentGuid: {
type: GuidEntity,
},
"bHidden": false,
"bNotConnectable": false,
"bDefaultValueIsReadOnly": false,
"bDefaultValueIsIgnored": false,
"bAdvancedView": false,
"bOrphanedPin": false,
bHidden: false,
bNotConnectable: false,
bDefaultValueIsReadOnly: false,
bDefaultValueIsIgnored: false,
bAdvancedView: false,
bOrphanedPin: false,
}
static {
@@ -130,17 +131,17 @@ export default class PinEntity extends IEntity {
/** @type {LocalizedTextEntity | String} */ this.PinFriendlyName
/** @type {String} */ this.PinToolTip
/** @type {String} */ this.Direction
this.PinType$PinCategory ??= /** @type {String} */(undefined)
this.PinType$PinSubCategory ??= /** @type {String} */(undefined)
this.PinType$PinSubCategoryObject ??= /** @type {ObjectReferenceEntity} */(undefined)
this.PinType$PinSubCategoryMemberReference ??= /** @type {FunctionReferenceEntity} */(undefined)
this.PinType$PinValueType ??= /** @type {PinTypeEntity} */(undefined)
this.PinType$ContainerType ??= /** @type {PathSymbolEntity} */(undefined)
this.PinType$bIsReference ??= /** @type {Boolean} */(undefined)
this.PinType$bIsConst ??= /** @type {Boolean} */(undefined)
this.PinType$bIsWeakPointer ??= /** @type {Boolean} */(undefined)
this.PinType$bIsUObjectWrapper ??= /** @type {Boolean} */(undefined)
this.PinType$bIsUObjectWrapper ??= /** @type {Boolean} */(undefined)
/** @type {String} */ this.PinType$PinCategory
/** @type {String} */ this.PinType$PinSubCategory
/** @type {ObjectReferenceEntity} */ this.PinType$PinSubCategoryObject
/** @type {FunctionReferenceEntity} */ this.PinType$PinSubCategoryMemberReference
/** @type {PinTypeEntity} */ this.PinType$PinValueType
/** @type {PathSymbolEntity} */ this.PinType$ContainerType
/** @type {Boolean} */ this.PinType$bIsReference
/** @type {Boolean} */ this.PinType$bIsConst
/** @type {Boolean} */ this.PinType$bIsWeakPointer
/** @type {Boolean} */ this.PinType$bIsUObjectWrapper
/** @type {Boolean} */ this.PinType$bIsUObjectWrapper
/** @type {PinReferenceEntity[]} */ this.LinkedTo
/** @type {T} */ this.DefaultValue
/** @type {String} */ this.AutogeneratedDefaultValue