Example #1
0
        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());
        }
Example #2
0
 /// <summary>
 /// Traffic Light whose State Changes drive the synching of the cluster
 /// </summary>
 /// <returns></returns>
 public ITrafficLight MasterTrafficLight()
 {
     return(TrafficLights.FirstOrDefault());
 }