mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-27 02:34:45 +08:00
Moving node and pins information to Configuration
This commit is contained in:
@@ -19,6 +19,7 @@ import Utility from "../Utility"
|
||||
* nullable?: Boolean,
|
||||
* ignored?: Boolean,
|
||||
* serialized?: Boolean,
|
||||
* expected?: Boolean,
|
||||
* predicate?: (value: AnyValue) => Boolean,
|
||||
* }} AttributeInformation
|
||||
*/
|
||||
@@ -38,6 +39,7 @@ export default class IEntity {
|
||||
nullable: false,
|
||||
ignored: false,
|
||||
serialized: false,
|
||||
expected: false,
|
||||
}
|
||||
|
||||
constructor(values = {}, suppressWarns = false) {
|
||||
@@ -222,6 +224,12 @@ export default class IEntity {
|
||||
return value != null && (value instanceof type || value.constructor === type)
|
||||
}
|
||||
|
||||
static expectsAllKeys() {
|
||||
return !Object.values(this.attributes)
|
||||
.filter(/** @param {AttributeInformation} attribute */attribute => !attribute.ignored)
|
||||
.some(/** @param {AttributeInformation} attribute */attribute => !attribute.expected)
|
||||
}
|
||||
|
||||
unexpectedKeys() {
|
||||
return Object.keys(this).length
|
||||
- Object.keys(/** @type {typeof IEntity} */(this.constructor).attributes).length
|
||||
|
||||
@@ -7,17 +7,19 @@ export default class LinearColorEntity extends IEntity {
|
||||
static attributes = {
|
||||
R: {
|
||||
type: RealUnitEntity,
|
||||
expected: true,
|
||||
},
|
||||
G: {
|
||||
type: RealUnitEntity,
|
||||
expected: true,
|
||||
},
|
||||
B: {
|
||||
type: RealUnitEntity,
|
||||
expected: true,
|
||||
},
|
||||
A: {
|
||||
type: RealUnitEntity,
|
||||
value: () => new RealUnitEntity(1),
|
||||
showDefault: true,
|
||||
},
|
||||
H: {
|
||||
type: RealUnitEntity,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import ByteEntity from "./ByteEntity"
|
||||
import FunctionReferenceEntity from "./FunctionReferenceEntity"
|
||||
import GuidEntity from "./GuidEntity"
|
||||
import IEntity from "./IEntity"
|
||||
import Integer64Entity from "./Integer64Entity"
|
||||
@@ -6,6 +7,7 @@ import IntegerEntity from "./IntegerEntity"
|
||||
import LinearColorEntity from "./LinearColorEntity"
|
||||
import LocalizedTextEntity from "./LocalizedTextEntity"
|
||||
import ObjectReferenceEntity from "./ObjectReferenceEntity"
|
||||
import PathSymbolEntity from "./PathSymbolEntity"
|
||||
import PinReferenceEntity from "./PinReferenceEntity"
|
||||
import RotatorEntity from "./RotatorEntity"
|
||||
import SimpleSerializationRotatorEntity from "./SimpleSerializationRotatorEntity"
|
||||
@@ -66,7 +68,7 @@ export default class PinEntity extends IEntity {
|
||||
type: ObjectReferenceEntity,
|
||||
},
|
||||
PinSubCategoryMemberReference: {
|
||||
type: ObjectReferenceEntity,
|
||||
type: FunctionReferenceEntity,
|
||||
value: null,
|
||||
},
|
||||
PinValueType: {
|
||||
@@ -74,7 +76,7 @@ export default class PinEntity extends IEntity {
|
||||
value: null,
|
||||
},
|
||||
ContainerType: {
|
||||
type: ObjectReferenceEntity,
|
||||
type: PathSymbolEntity,
|
||||
},
|
||||
bIsReference: false,
|
||||
bIsConst: false,
|
||||
@@ -128,9 +130,9 @@ export default class PinEntity extends IEntity {
|
||||
* PinCategory: String,
|
||||
* PinSubCategory: String,
|
||||
* PinSubCategoryObject: ObjectReferenceEntity,
|
||||
* PinSubCategoryMemberReference: any,
|
||||
* PinSubCategoryMemberReference: FunctionReferenceEntity,
|
||||
* PinValueType: String,
|
||||
* ContainerType: ObjectReferenceEntity,
|
||||
* ContainerType: PathSymbolEntity,
|
||||
* bIsReference: Boolean,
|
||||
* bIsConst: Boolean,
|
||||
* bIsWeakPointer: Boolean,
|
||||
|
||||
@@ -3,8 +3,14 @@ import IEntity from "./IEntity"
|
||||
export default class Vector2DEntity extends IEntity {
|
||||
|
||||
static attributes = {
|
||||
X: 0,
|
||||
Y: 0,
|
||||
X: {
|
||||
value: 0,
|
||||
expected: true,
|
||||
},
|
||||
Y: {
|
||||
value: 0,
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
@@ -3,9 +3,18 @@ import IEntity from "./IEntity"
|
||||
export default class VectorEntity extends IEntity {
|
||||
|
||||
static attributes = {
|
||||
X: 0,
|
||||
Y: 0,
|
||||
Z: 0,
|
||||
X: {
|
||||
value: 0,
|
||||
expected: true,
|
||||
},
|
||||
Y: {
|
||||
value: 0,
|
||||
expected: true,
|
||||
},
|
||||
Z: {
|
||||
value: 0,
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
static {
|
||||
|
||||
Reference in New Issue
Block a user