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’s RegionLab or has an outgoing Route whose Destination == region.
  • GetGroupRoutes(region) returns the routes attached to the group that feeds the region.
  • GetIncomingRoute(region) returns the single route (if any) that delivers to region.

Notes

  • RegisterLab/UnregisterLab are called from Laboratory.Awake() / OnDestroy().
  • Route registration is driven by Laboratory.AddRoute() and removal helpers.