Files
ueblueprint/js/entity/IntegerEntity.js
2022-11-21 11:45:43 +01:00

24 lines
457 B
JavaScript
Executable File

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