Small refactoring

This commit is contained in:
barsdeveloper
2021-12-11 23:58:40 +01:00
parent 6b02ab7e08
commit a5c4f04f2b
11 changed files with 235 additions and 150 deletions

View File

@@ -11,6 +11,11 @@ export default class IntegerEntity extends Entity {
}
constructor(options = {}) {
if (options.constructor === Number || options.constructor === String) {
options = {
value: options
}
}
super(options)
this.value = Math.round(this.value)
}

View File

@@ -41,22 +41,6 @@ export default class PinEntity extends Entity {
return PinEntity.attributes
}
/**
*
* @returns {String}
*/
getPinDisplayName() {
return this.PinName
}
isConnected() {
return this.LinkedTo.length > 0
}
getType() {
return this.PinType.PinCategory ?? "object"
}
isInput() {
if (!this.bHidden && this.Direction !== "EGPD_Output") {
return true
@@ -68,4 +52,12 @@ export default class PinEntity extends Entity {
return true
}
}
isConnected() {
return this.LinkedTo.length > 0
}
getType() {
return this.PinType.PinCategory ?? "object"
}
}