mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 00:54:48 +08:00
27 lines
469 B
JavaScript
27 lines
469 B
JavaScript
import IEntity from "./IEntity.js"
|
|
import Utility from "../Utility.js"
|
|
|
|
export default class RealUnitEntity extends IEntity {
|
|
|
|
static attributes = {
|
|
value: 0,
|
|
}
|
|
|
|
static {
|
|
this.cleanupAttributes(this.attributes)
|
|
}
|
|
|
|
constructor(values = 0) {
|
|
super(values)
|
|
this.value = Utility.clamp(this.value, 0, 1)
|
|
}
|
|
|
|
valueOf() {
|
|
return this.value
|
|
}
|
|
|
|
toString() {
|
|
return this.value.toFixed(6)
|
|
}
|
|
}
|