import type { Prop } from '../classes/Prop'; import { Vector2 } from '../types/Vector2'; import { Vector3 } from '../types/Vector3'; import { Vector4 } from '../types/Vector4'; import { Color } from '../types/Color'; import { IHandle } from '../types/IHandle'; import { registerHandle, createFromHandle } from '../types/HandleRegistry'; import { inv, rai, raf, ras, rav, pvi, pvf, pvv, pvii, pvfi, _h, f, int, uint, float, Hash, u8, u16, u32, u64, i8, i16, i32, i64 } from '../types/NativeAliases'; export class Pickup implements IHandle { constructor(public handle: number) {} static fromHandle(handle: number): Pickup | null { return handle === 0 ? null : new Pickup(handle); } /** * @returns */ hasBeenCollected(): boolean { return !!inv('0x80EC48E6679313F9', this.handle, rai()); } /** * @returns */ doesExist(): boolean { return !!inv('0xAFC1CA75AD4074D1', this.handle, rai()); } /** * @returns */ get Object(): Prop | null { return createFromHandle('Prop', inv('0x5099BC55630B25AE', this.handle, rai())); } /** * @param duration */ set RegenerationTime(duration: int) { inv('0x78015C9B4B3ECC9D', this.handle, duration); } /** * @param duration * @returns The instance for method chaining */ setRegenerationTime(duration: int): this { inv('0x78015C9B4B3ECC9D', this.handle, duration); return this; } /** * @returns */ get Coords(): Vector3 { return Vector3.fromArray(inv('0x225B8B35C88029B3', this.handle, rav())); } removePickup(): void { inv('0x3288D8ACAECD2AB2', this.handle); } } registerHandle('Pickup', Pickup);