mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-04 14:27:29 +08:00
Inline attributes semantics and tests
This commit is contained in:
@@ -3,7 +3,6 @@ import ComputedType from "./ComputedType.js"
|
||||
import Configuration from "../Configuration.js"
|
||||
import EnumEntity from "./EnumEntity.js"
|
||||
import FormatTextEntity from "./FormatTextEntity.js"
|
||||
import FunctionReferenceEntity from "./FunctionReferenceEntity.js"
|
||||
import GuidEntity from "./GuidEntity.js"
|
||||
import IEntity from "./IEntity.js"
|
||||
import Integer64Entity from "./Integer64Entity.js"
|
||||
@@ -11,13 +10,12 @@ import IntegerEntity from "./IntegerEntity.js"
|
||||
import LinearColorEntity from "./LinearColorEntity.js"
|
||||
import LocalizedTextEntity from "./LocalizedTextEntity.js"
|
||||
import ObjectReferenceEntity from "./ObjectReferenceEntity.js"
|
||||
import PathSymbolEntity from "./PathSymbolEntity.js"
|
||||
import PinReferenceEntity from "./PinReferenceEntity.js"
|
||||
import PinTypeEntity from "./PinTypeEntity.js"
|
||||
import RotatorEntity from "./RotatorEntity.js"
|
||||
import SimpleSerializationRotatorEntity from "./SimpleSerializationRotatorEntity.js"
|
||||
import SimpleSerializationVector2DEntity from "./SimpleSerializationVector2DEntity.js"
|
||||
import SimpleSerializationVectorEntity from "./SimpleSerializationVectorEntity.js"
|
||||
import TerminalTypeEntity from "./TerminalTypeEntity.js"
|
||||
import UnionType from "./UnionType.js"
|
||||
import Utility from "../Utility.js"
|
||||
import Vector2DEntity from "./Vector2DEntity.js"
|
||||
@@ -71,40 +69,9 @@ export default class PinEntity extends IEntity {
|
||||
type: String,
|
||||
showDefault: false,
|
||||
},
|
||||
PinType$PinCategory: {
|
||||
default: "",
|
||||
},
|
||||
PinType$PinSubCategory: {
|
||||
default: "",
|
||||
},
|
||||
PinType$PinSubCategoryObject: {
|
||||
type: ObjectReferenceEntity,
|
||||
},
|
||||
PinType$PinSubCategoryMemberReference: {
|
||||
type: FunctionReferenceEntity,
|
||||
default: null,
|
||||
},
|
||||
PinType$PinValueType: {
|
||||
type: TerminalTypeEntity,
|
||||
default: null,
|
||||
},
|
||||
PinType$ContainerType: {
|
||||
type: PathSymbolEntity,
|
||||
},
|
||||
PinType$bIsReference: {
|
||||
default: false,
|
||||
},
|
||||
PinType$bIsConst: {
|
||||
default: false,
|
||||
},
|
||||
PinType$bIsWeakPointer: {
|
||||
default: false,
|
||||
},
|
||||
PinType$bIsUObjectWrapper: {
|
||||
default: false,
|
||||
},
|
||||
PinType$bSerializeAsSinglePrecisionFloat: {
|
||||
default: false,
|
||||
PinType: {
|
||||
type: PinTypeEntity,
|
||||
inlined: true,
|
||||
},
|
||||
LinkedTo: {
|
||||
type: [PinReferenceEntity],
|
||||
@@ -167,17 +134,7 @@ export default class PinEntity extends IEntity {
|
||||
/** @type {LocalizedTextEntity | String} */ this.PinFriendlyName
|
||||
/** @type {String} */ this.PinToolTip
|
||||
/** @type {String} */ this.Direction
|
||||
/** @type {String} */ this.PinType$PinCategory
|
||||
/** @type {String} */ this.PinType$PinSubCategory
|
||||
/** @type {ObjectReferenceEntity} */ this.PinType$PinSubCategoryObject
|
||||
/** @type {FunctionReferenceEntity} */ this.PinType$PinSubCategoryMemberReference
|
||||
/** @type {TerminalTypeEntity} */ 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 {PinTypeEntity} */ this.PinType
|
||||
/** @type {PinReferenceEntity[]} */ this.LinkedTo
|
||||
/** @type {T} */ this.DefaultValue
|
||||
/** @type {String} */ this.AutogeneratedDefaultValue
|
||||
@@ -192,12 +149,12 @@ export default class PinEntity extends IEntity {
|
||||
}
|
||||
|
||||
getType() {
|
||||
const subCategory = this.PinType$PinSubCategoryObject
|
||||
if (this.PinType$PinCategory === "struct" || this.PinType$PinCategory === "object") {
|
||||
const subCategory = this.PinType.PinSubCategoryObject
|
||||
if (this.PinType.PinCategory === "struct" || this.PinType.PinCategory === "object") {
|
||||
return subCategory.path
|
||||
}
|
||||
if (
|
||||
this.PinType$PinCategory === "byte"
|
||||
this.PinType.PinCategory === "byte"
|
||||
&& (
|
||||
subCategory.type === Configuration.nodeType.enum
|
||||
|| subCategory.type === Configuration.nodeType.userDefinedEnum
|
||||
@@ -205,7 +162,7 @@ export default class PinEntity extends IEntity {
|
||||
) {
|
||||
return "enum"
|
||||
}
|
||||
return this.PinType$PinCategory
|
||||
return this.PinType.PinCategory
|
||||
}
|
||||
|
||||
getEntityType(alternative = false) {
|
||||
@@ -234,16 +191,16 @@ export default class PinEntity extends IEntity {
|
||||
|
||||
/** @param {PinEntity} other */
|
||||
copyTypeFrom(other) {
|
||||
this.PinType$PinCategory = other.PinType$PinCategory
|
||||
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.PinCategory = other.PinType.PinCategory
|
||||
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
|
||||
}
|
||||
|
||||
@@ -255,7 +212,7 @@ export default class PinEntity extends IEntity {
|
||||
}
|
||||
|
||||
isExecution() {
|
||||
return this.PinType$PinCategory === "exec"
|
||||
return this.PinType.PinCategory === "exec"
|
||||
}
|
||||
|
||||
isHidden() {
|
||||
@@ -313,13 +270,13 @@ export default class PinEntity extends IEntity {
|
||||
}
|
||||
|
||||
getSubCategory() {
|
||||
return this.PinType$PinSubCategoryObject.path
|
||||
return this.PinType.PinSubCategoryObject.path
|
||||
}
|
||||
|
||||
/** @return {CSSResult} */
|
||||
pinColor() {
|
||||
return Configuration.pinColor[this.getType()]
|
||||
?? Configuration.pinColor[this.PinType$PinCategory.toLowerCase()]
|
||||
?? Configuration.pinColor[this.PinType.PinCategory.toLowerCase()]
|
||||
?? Configuration.pinColor["default"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user