// UE/UEArray.ts import type { Integer } from '#root/UE/Integer.ts'; export class UEArray extends Array { constructor(items?: T[]) { super(); if (items) { this.push(...items); } Object.setPrototypeOf(this, UEArray.prototype); } public SetArrayElem( Index: Integer = 0, Item: T, SizeToFit: boolean = false ): void { this[Index] = Item; if (SizeToFit && Index >= this.length) { this.length = Index + 1; } } public Add(Item: T): Integer { this.push(Item); return this.length - 1; } public Get(Index: Integer): T { return this[Index]!; } public RemoveIndex(Index: Integer): void { this.splice(Index, 1); } public Remove(Item: T): void { const index = this.indexOf(Item); if (index !== -1) { this.splice(index, 1); } } }