mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
24 lines
475 B
JavaScript
24 lines
475 B
JavaScript
import Entity from "./Entity"
|
|
|
|
export default class Integer extends Entity {
|
|
|
|
static attributes = {
|
|
value: 0
|
|
}
|
|
|
|
constructor(value) {
|
|
if (value?.constructor === String) {
|
|
value = Number(value)
|
|
}
|
|
if (value?.constructor === Number) {
|
|
value = {
|
|
value: Math.round(value.valueOf())
|
|
}
|
|
}
|
|
super(value)
|
|
}
|
|
|
|
getAttributes() {
|
|
return Integer.attributes
|
|
}
|
|
} |