mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-11 14:24:42 +08:00
24 lines
484 B
JavaScript
24 lines
484 B
JavaScript
import IEntity from "./IEntity"
|
|
import Utility from "../Utility"
|
|
|
|
export default class RealUnitEntity extends IEntity {
|
|
|
|
static attributes = {
|
|
value: Number,
|
|
}
|
|
|
|
/** @param {Object | Number | String} options */
|
|
constructor(options = 0) {
|
|
super(options)
|
|
/** @type {Number} */
|
|
this.value = Utility.clamp(this.value, 0, 1)
|
|
}
|
|
|
|
valueOf() {
|
|
return this.value
|
|
}
|
|
|
|
toString() {
|
|
return this.value.toFixed(6)
|
|
}
|
|
} |