Fix caching, Limits placement, and explain the board better

This commit is contained in:
Jesse
2026-07-31 23:34:18 -04:00
parent 2eca9de09f
commit dd300ac154
10 changed files with 466 additions and 26 deletions
+5 -2
View File
@@ -35,7 +35,7 @@ export type { CellView, DivisionView, FacilityView, Frame, Decision, TrainChip }
export { cardName, describeIntent, snapshot } from './view.ts';
import type { Frame } from './view.ts';
import type { Decision } from './view.ts';
import { cardName, describeDecision, snapshot } from './view.ts';
import { cardName, describeDecision, snapshot, trainName } from './view.ts';
// ---------------------------------------------------------------------------
// Frame shape — only what the viewer draws
@@ -61,7 +61,10 @@ export function record(seed: number, length: GameLength, maxSteps = 100_000): Re
};
const s = createGame({ id: `replay-${seed}`, seed, config, playerNames: ['player'] });
const frames: Frame[] = [];
const narrateCtx = { cardName: (id: string) => cardName(s, id) };
const narrateCtx = {
cardName: (id: string) => cardName(s, id),
trainName: (id: string) => trainName(s, id),
};
// Tracks whether a phase did anything, so an empty one can say so rather than ending silently.
let didSomething = false;