import type { ItemSet } from '../classes/ItemSet'; 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 PropSet implements IHandle { constructor(public handle: number) {} static fromHandle(handle: number): PropSet | null { return handle === 0 ? null : new PropSet(handle); } /** * @returns */ get IsPropSetVisible(): boolean { return !!inv('0x0CE8AAFE9E433A23', this.handle, rai()); } /** * @returns */ doesPropSetExist(): boolean { return !!inv('0x7DDDCF815E650FF5', this.handle, rai()); } /** * @returns */ get PropSetModel(): number { return (inv('0xA6A9712955F53D9C', this.handle, rai())) & 0xFFFFFFFF; } /** * @param itemSet * @param model * @param p3 * @param p4 * @returns */ getEntitiesFromPropSet(itemSet: ItemSet, model: string | number, p3: boolean, p4: boolean): int { return inv('0x738271B660FE0695', this.handle, itemSet.handle, _h(model), p3, p4, rai()); } /** * @param flag */ set PropSetFlag(flag: int) { inv('0xC1AB7EEFD3E6EE49', this.handle, flag); } /** * @param flag * @returns The instance for method chaining */ setPropSetFlag(flag: int): this { inv('0xC1AB7EEFD3E6EE49', this.handle, flag); return this; } /** * @returns The instance for method chaining */ setPropSetAsNoLongerNeeded(): this { inv('0x909E3C7FAE539FB1', this.handle); return this; } /** * @param toggle */ set PropSetVisible(toggle: boolean) { inv('0x9D096A5BD02F953E', this.handle, toggle); } /** * @param toggle * @returns The instance for method chaining */ setPropSetVisible(toggle: boolean): this { inv('0x9D096A5BD02F953E', this.handle, toggle); return this; } /** * @returns */ get IsPropSetFullyLoaded(): boolean { return !!inv('0xF42DB680A8B2A4D9', this.handle, rai()); } /** * @param p1 * @param p2 */ deletePropSet(p1: boolean, p2: boolean): void { inv('0x58AC173A55D9D7B4', this.handle, p1, p2); } } registerHandle('PropSet', PropSet);