Files
ueblueprint/js/entity/IntegerEntity.js
2023-01-02 00:22:50 +01:00

27 lines
495 B
JavaScript
Executable File

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