Files
ueblueprint/js/entity/IntegerEntity.js
2021-12-05 20:49:07 +01:00

26 lines
466 B
JavaScript
Executable File

import Entity from "./Entity"
export default class IntegerEntity extends Entity {
static attributes = {
value: Number
}
getAttributes() {
return IntegerEntity.attributes
}
constructor(options = { value: 0 }) {
options.value = Math.round(options.value)
super(options)
}
valueOf() {
return this.value
}
toString() {
return this.value.toString()
}
}