export class LevelManager { private static _instance: LevelManager | undefined; static get instance(): LevelManager { if (!LevelManager._instance) { LevelManager._instance = new LevelManager(); } return LevelManager._instance; } private readonly minIndex: number = 1; private currentIndex = 1; getCurrentIndex(): number { return this.currentIndex; } setCurrentIndex(index: number): void { const clamped = Math.max(this.minIndex, Math.floor(index || 0)); this.currentIndex = clamped; } getNextIndex(): number { return this.currentIndex + 1; } }