Fixed division end of track labels and other minor bugs. Trains now show their information. Play cards now required to get to 3 or less, no other restrictions. auto hide now more prominent. it and sounds now are in replay.

This commit is contained in:
Jesse
2026-08-04 13:43:28 -04:00
parent c3c5c59a45
commit 4bba991f41
11 changed files with 466 additions and 161 deletions
+22
View File
@@ -536,3 +536,25 @@ export function trainPositions(s: GameState): { id: TrayId; label: string; where
}
export { coordKey };
/**
* What a batch of events should SOUND like.
*
* Shared between the live game and the replay so the two cannot disagree about when a Stage ended.
* The model names what happened; the page decides what it sounds like.
*/
export function cuesFor(events: readonly GameEvent[]): string[] {
const out: string[] = [];
for (const e of events) {
if (e.type === 'trainMadeUp') out.push('train');
if (e.type === 'stageBegan') {
// A Stage BEGINNING is the previous one ending — except the first, which is the game opening
// and has nothing behind it. A Day boundary rings the bell only: sounding both would collide,
// and the bell is the bigger event.
if (e.day > 1 && e.stage === 1) out.push('day');
else if (e.day > 1 || e.stage > 1) out.push('stage');
}
}
return out;
}