Files
ueblueprint/js/entity/IntegerEntity.js
2022-09-04 14:33:22 +02:00

25 lines
448 B
JavaScript
Executable File

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