Track becomes a deck card, Departments become decks, and trains must be made up to leave, industry restrictions enforced, update display and add a new game button

This commit is contained in:
Jesse
2026-08-05 08:28:22 -04:00
parent 2d348e1ecf
commit 9c76b1a5e2
28 changed files with 1927 additions and 394 deletions
+7 -1
View File
@@ -34,7 +34,7 @@ import type {
TrackArc,
TurnoutOrientation,
} from './state.ts';
import { carsOn, coordKey, isOperationalRail, spaceOn } from './state.ts';
import { carsOn, coordKey, isLockedByWork, isOperationalRail, spaceOn } from './state.ts';
// ---------------------------------------------------------------------------
// Ports and geometry
@@ -357,6 +357,12 @@ export function reachableDestinations(
if (!hasPort(card, node.entry)) continue;
// §9.3 — a locked industry may not be occupied OR MOVED ON. Losing Operational Rail status only
// stops a train FINISHING here; a turnout is not Operational Rail either and trains run through
// one all day. Without this a crew rolled straight over a locked industry, and coupled the cars
// spotted on it on the way past — the two things the safety lockout exists to prevent.
if (isLockedByWork(card)) continue;
// Mandatory coupling. Rejecting rather than truncating is deliberate: a move that would
// overfill the tray is illegal, not a move that picks up fewer cars.
const couples = [...node.couples, ...carsOn(card)];