routesForSlot function
List<({NmGroupRule rule, NmZone zone})>
routesForSlot(
- NmZoneController zones,
- String commandSetId,
- int slot
Read-only route context for a plan's direction slot: every NmGroupRule in
zones whose limitSlot matches, restricted to zones that belong to
commandSetId's operator/region (matched by the shared <operator>_<region>
naming convention both features use — see 03-specifications.md's Resolved
Design Decisions). Never mutates Zones data; purely a live projection.
Implementation
List<({NmZone zone, NmGroupRule rule})> routesForSlot(NmZoneController zones, String commandSetId, int slot) => [
for (final zone in zones.records)
if (_belongsToCommandSet(zone, commandSetId))
for (final rule in zone.groupRules)
if (rule.limitSlot == slot) (zone: zone, rule: rule),
];