|
2 | 2 | // cards.ts), gathered by the same helpers (shared/world/cardFacts.ts, edgeText.ts), with each claim |
3 | 3 | // followed by its state in brackets and the evidence behind it on the next line. |
4 | 4 | import { NOT_IN_DESIGN } from '../../shared/world/reconcile' |
5 | | -import { BUILD_STATUS_TEXT, allBuildings, allEdges, evidenceText, nodeName, notInDesign, runsIn } from '../../shared/world/cardFacts' |
| 5 | +import { BUILD_STATUS_TEXT, NO_WHY_YET, allBuildings, allEdges, edgeFromCode, evidenceText, nodeName, notInDesign, runsIn } from '../../shared/world/cardFacts' |
6 | 6 | import { edgeItems, edgeSummary } from '../../shared/world/edgeText' |
7 | 7 | import type { Claim, WorldDoc, WorldEdge } from '../../shared/world/types' |
8 | 8 |
|
9 | 9 | const section = (title: string, lines: string[]): string[] => ['', `${title}:`, ...lines] |
10 | 10 |
|
11 | | -/** One line per claim, "text [state]", then its evidence. None reads as "Not described yet.". */ |
12 | | -function claimLines(list: Claim[]): string[] { |
13 | | - if (list.length === 0) return ['Not described yet.'] |
| 11 | +/** One line per claim, "text [state]", then its evidence. None reads as `empty`. */ |
| 12 | +function claimLines(list: Claim[], empty = 'Not described yet.'): string[] { |
| 13 | + if (list.length === 0) return [empty] |
14 | 14 | return list.flatMap((c) => { |
15 | 15 | const ev = c.evidence.map(evidenceText).join('; ') |
16 | 16 | return [`- ${c.text} [${c.state}]`, ...(ev ? [` evidence: ${ev}`] : [])] |
@@ -65,9 +65,10 @@ function edgeText(doc: WorldDoc, id: string): string { |
65 | 65 | `${nodeName(doc, e.from)} (${e.from}) -> ${nodeName(doc, e.to)} (${e.to})${e.twoWay ? ' (both ways)' : ''}`, |
66 | 66 | ...(items ? section('What it carries', items.map((i) => `- ${i}`)) : title !== e.label.trim() ? [e.label] : []), |
67 | 67 | ...section('What travels', [cargo ? cargo.label : e.cargo]), |
68 | | - ...section('How it travels', claimLines(e.how)), |
| 68 | + // A line no model described still says what the code shows. |
| 69 | + ...section('How it travels', claimLines(e.how, edgeFromCode(doc, e))), |
69 | 70 | ...(e.tech.length ? section('Technology', techLine(doc, e.tech)) : []), |
70 | | - ...section('Why it is done this way', claimLines(e.why)), |
| 71 | + ...section('Why it is done this way', claimLines(e.why, NO_WHY_YET)), |
71 | 72 | ...known(e.claims), |
72 | 73 | ...(e.rate ? section('How often', [e.rate]) : []) |
73 | 74 | ] |
|
0 commit comments