Expand game engine, replay, tests, and documentation

This commit is contained in:
Jesse
2026-07-31 08:10:54 -04:00
parent e7bc07df85
commit 401b879140
30 changed files with 2253 additions and 552 deletions
+10 -6
View File
@@ -120,12 +120,11 @@ export function summarize(
if (e.type === 'clearanceRequested') clearanceRequests++;
if (e.type === 'clearanceGiven' && e.allow) clearancesAllowed++;
// The driver reports train lifecycle through `phaseBegan` labels.
if (e.type === 'phaseBegan') {
if (e.phase.includes('highballed')) highballed++;
else if (e.phase.includes('arrived')) arrived++;
else if (e.phase.includes('completed')) completed++;
}
// Train lifecycle now has proper event types; it used to be smuggled through `phaseBegan`
// free text, which made the replay unable to say anything useful about it.
if (e.type === 'trainHighballed') highballed++;
else if (e.type === 'trainArrived') arrived++;
else if (e.type === 'trainCompleted') completed++;
}
for (const i of intents) inc(intentCounts, i);
@@ -213,6 +212,11 @@ export function summarize(
*/
const EXPECTED_EVENTS = [
'trainScheduled',
'extraQueued',
'trainMadeUp',
'trainHighballed',
'trainArrived',
'trainCompleted',
'carPlacedOnTrain',
'trayMoved',
'carsCoupled',