Expand game engine, replay, tests, and documentation
This commit is contained in:
+10
-6
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user