mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-07 11:37:30 +08:00
Prevent error from unexpected attribute
This commit is contained in:
8
js/entity/EnumEntity.js
Executable file
8
js/entity/EnumEntity.js
Executable file
@@ -0,0 +1,8 @@
|
||||
import ByteEntity from "./ByteEntity"
|
||||
|
||||
export default class EnumEntity extends ByteEntity {
|
||||
|
||||
constructor(values = 0) {
|
||||
super(values)
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,8 @@ import Utility from "../Utility"
|
||||
|
||||
/**
|
||||
* @template {AnyValue} T
|
||||
* @typedef {(new () => T) | EntityConstructor | StringConstructor | NumberConstructor | BigIntConstructor | BooleanConstructor | ArrayConstructor} AnyValueConstructor
|
||||
* @typedef {(new () => T) | EntityConstructor | StringConstructor | NumberConstructor | BigIntConstructor
|
||||
* | BooleanConstructor | ArrayConstructor} AnyValueConstructor
|
||||
*/
|
||||
|
||||
export default class IEntity {
|
||||
@@ -54,6 +55,12 @@ export default class IEntity {
|
||||
/** @type {AttributeInformation} */
|
||||
let attribute = attributes[attributeName]
|
||||
|
||||
if (!attribute) {
|
||||
// Remember attributeName can come from the values and be not defined in the attributes
|
||||
target[attributeName] = value
|
||||
continue
|
||||
}
|
||||
|
||||
if (attribute instanceof SubAttributesDeclaration) {
|
||||
target[attributeName] = {}
|
||||
defineAllAttributes(
|
||||
|
||||
Reference in New Issue
Block a user