Integer => IntegerEntity, No more primitive

This commit is contained in:
barsdeveloper
2021-11-23 21:01:07 +01:00
parent 6a3e2cc36f
commit c774886a2e
8 changed files with 52 additions and 85 deletions

21
js/entity/IntegerEntity.js Executable file
View File

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