mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-15 12:52:20 +02:00
[Misc] Make FixedInt support coercion to number primitive (#6081)
This commit is contained in:
parent
8c05693b83
commit
ee02366ccf
@ -341,6 +341,10 @@ export class NumberHolder {
|
||||
constructor(value: number) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
valueOf(): number {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
export class FixedInt {
|
||||
@ -349,6 +353,10 @@ export class FixedInt {
|
||||
constructor(value: number) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
[Symbol.toPrimitive](_hint: string): number {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
export function fixedInt(value: number): number {
|
||||
|
Loading…
Reference in New Issue
Block a user