mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-13 06:57:28 +08:00
Attributes initialization refactoring (#19)
This commit is contained in:
@@ -1,37 +1,21 @@
|
||||
import Entity1 from "./Entity1.js"
|
||||
import AttributeInfo from "../../js/entity/AttributeInfo.js"
|
||||
import IEntity from "../../js/entity/IEntity.js"
|
||||
import Entity1 from "./Entity1.js"
|
||||
|
||||
export default class Entity2 extends IEntity {
|
||||
|
||||
static attributes = {
|
||||
someNumber: {
|
||||
default: 567,
|
||||
},
|
||||
someString: {
|
||||
default: "alpha",
|
||||
},
|
||||
someString2: {
|
||||
default: "beta",
|
||||
},
|
||||
someBoolean: {
|
||||
default: true,
|
||||
},
|
||||
someBoolean2: {
|
||||
default: false,
|
||||
},
|
||||
someObjectString: {
|
||||
default: "gamma",
|
||||
},
|
||||
someArray: {
|
||||
default: [400, 500, 600, 700, 800],
|
||||
},
|
||||
someEntity: {
|
||||
someNumber: AttributeInfo.createValue(567),
|
||||
someString: AttributeInfo.createValue("alpha"),
|
||||
someString2: AttributeInfo.createValue("beta"),
|
||||
someBoolean: AttributeInfo.createValue(true),
|
||||
someBoolean2: AttributeInfo.createValue(false),
|
||||
someObjectString: AttributeInfo.createValue("gamma"),
|
||||
someArray: AttributeInfo.createValue([400, 500, 600, 700, 800]),
|
||||
someArray2: AttributeInfo.createValue(() => [400, 500, 600, 700, 800]),
|
||||
someEntity: new AttributeInfo({
|
||||
type: Entity1,
|
||||
default: new Entity1()
|
||||
},
|
||||
}
|
||||
|
||||
static {
|
||||
this.cleanupAttributes(this.attributes)
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user