New keys for object, refactoring.

This commit is contained in:
barsdeveloper
2021-12-05 20:49:07 +01:00
parent 07afb4bcb9
commit 76ae9ed3c0
26 changed files with 165 additions and 142 deletions

View File

@@ -10,9 +10,13 @@ export default class IntegerEntity extends Entity {
return IntegerEntity.attributes
}
constructor(options = {}) {
constructor(options = { value: 0 }) {
options.value = Math.round(options.value)
super(options)
this.value = Math.round(value)
}
valueOf() {
return this.value
}
toString() {

View File

@@ -1,6 +1,7 @@
import Entity from "./Entity"
import FunctionReferenceEntity from "./FunctionReferenceEntity"
import GuidEntity from "./GuidEntity"
import IntegerEntity from "./IntegerEntity"
import ObjectReferenceEntity from "./ObjectReferenceEntity"
import PinEntity from "./PinEntity"
import TypeInitialization from "./TypeInitialization"
@@ -14,10 +15,13 @@ export default class ObjectEntity extends Entity {
bIsPureFunc: new TypeInitialization(Boolean, false, false),
VariableReference: new TypeInitialization(VariableReferenceEntity, false, null),
FunctionReference: new TypeInitialization(FunctionReferenceEntity, false, null,),
EventReference: new TypeInitialization(FunctionReferenceEntity, false, null,),
TargetType: new TypeInitialization(ObjectReferenceEntity, false, null),
NodePosX: 0,
NodePosY: 0,
NodePosX: IntegerEntity,
NodePosY: IntegerEntity,
NodeGuid: GuidEntity,
ErrorType: new TypeInitialization(IntegerEntity, false),
ErrorMsg: new TypeInitialization(String, false, ""),
CustomProperties: [PinEntity]
}

View File

@@ -13,4 +13,4 @@ export default class PathSymbolEntity extends Entity {
toString() {
return this.value
}
}
}