LabGroupRegistrar
Overview
Static registry that groups a Laboratory with all of its outgoing Routes, enabling quick lookups like “which Lab supplies this Region?” and “what routes belong to this Lab group?”.
Data Model
- LabGroup —
{ Laboratory lab; List<Route> routes; }
API
public static void RegisterLab(Laboratory lab);
public static void UnregisterLab(Laboratory lab);
public static void RegisterRoute(Laboratory lab, Route route);
public static void UnregisterRoute(Laboratory lab, Route route);
public static Laboratory GetGroupLab(Region region);
public static List<Route> GetGroupRoutes(Region region);
public static Route GetIncomingRoute(Region region);
GetGroupLab(region)returns the Lab that either is the region’sRegionLabor has an outgoing Route whoseDestination == region.GetGroupRoutes(region)returns the routes attached to the group that feeds theregion.GetIncomingRoute(region)returns the single route (if any) that delivers toregion.
Notes
RegisterLab/UnregisterLabare called fromLaboratory.Awake()/OnDestroy().- Route registration is driven by
Laboratory.AddRoute()and removal helpers.