Attributes initialization refactoring (#19)

This commit is contained in:
barsdeveloper
2024-03-24 17:30:50 +01:00
committed by GitHub
parent 5973570911
commit cc9e3d833a
93 changed files with 4134 additions and 4082 deletions

View File

@@ -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)
}),
}
}