mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
27 lines
463 B
JavaScript
27 lines
463 B
JavaScript
import IEntity from "./IEntity"
|
|
import Utility from "../Utility"
|
|
|
|
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)
|
|
}
|
|
}
|