updated the dungeon loading so it doesnt fail first try

This commit is contained in:
phenom committed 2026-08-17 13:51:12 -04:00
1 parent e39aebf3a1
commit 7e60864e70
11 files changed
+383 -69

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { describe, expect, it } from "vitest";
import {
DUNGEON_COLLISION_LOAD_BATCH_SIZE,
DUNGEON_VISUAL_LOAD_BATCH_SIZE,
advanceDungeonAssetCount,
} from "./dungeonLoadSequencing";
describe("dungeon asset load sequencing", () => {
it("loads visuals individually and collision meshes in bounded batches", () => {
expect(DUNGEON_VISUAL_LOAD_BATCH_SIZE).toBe(1);
expect(DUNGEON_COLLISION_LOAD_BATCH_SIZE).toBe(4);
expect(advanceDungeonAssetCount(0, 48, DUNGEON_COLLISION_LOAD_BATCH_SIZE)).toBe(4);
expect(advanceDungeonAssetCount(44, 48, DUNGEON_COLLISION_LOAD_BATCH_SIZE)).toBe(48);
});
it("clamps malformed counters instead of creating an unbounded window", () => {
expect(advanceDungeonAssetCount(-3, 2, 0)).toBe(1);
expect(advanceDungeonAssetCount(8, 2, 4)).toBe(2);
});
});