Files
ueblueprint/js/entity/IntegerEntity.js
barsdeveloper 42615b93f8 Various fixes
2022-03-19 14:46:53 +01:00

27 lines
544 B
JavaScript
Executable File

import IEntity from "./IEntity"
export default class IntegerEntity extends IEntity {
static attributes = {
value: Number,
}
constructor(options = {}) {
if (options.constructor == Number || options.constructor == String) {
options = {
value: options,
}
}
super(options)
this.value = Math.round(this.value)
}
valueOf() {
return this.value
}
toString() {
return this.value.toString()
}
}