mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-22 14:54:43 +08:00
Integer => IntegerEntity, No more primitive
This commit is contained in:
21
js/entity/IntegerEntity.js
Executable file
21
js/entity/IntegerEntity.js
Executable 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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user