Files
healer-man/src/scene/dungeonLoadSequencing.ts
T

15 lines
518 B
TypeScript

export const DUNGEON_VISUAL_LOAD_BATCH_SIZE = 1;
export const DUNGEON_COLLISION_LOAD_BATCH_SIZE = 4;
/** Advances a staged asset window without overshooting the available files. */
export function advanceDungeonAssetCount(
loaded: number,
total: number,
batchSize: number,
): number {
const safeLoaded = Math.max(0, Math.trunc(loaded));
const safeTotal = Math.max(0, Math.trunc(total));
const safeBatchSize = Math.max(1, Math.trunc(batchSize));
return Math.min(safeTotal, safeLoaded + safeBatchSize);
}