public bool IsCompatible(TetheredTrafficLightCluster tetheredCluster) { if (tetheredCluster.Equals(TetheredTrafficLightCluster)) { return(false); } var tetheredTrafficIds = tetheredCluster.GetTrafficLightIds().ToList(); //if (tetheredTrafficIds.Contains(TrafficLight.Id)) //{ // return false; //} var polarTrafficIds = TrafficLights.Select(x => x.Id); return(!polarTrafficIds.Intersect(tetheredTrafficIds).Any()); }
/// <summary> /// Traffic Light whose State Changes drive the synching of the cluster /// </summary> /// <returns></returns> public ITrafficLight MasterTrafficLight() { return(TrafficLights.FirstOrDefault()); }