Esempio n. 1
0
        public TrafficLightDigits GetSectionsThatWasTurnedOff(Models.TrafficLight trafficLight, Observation[] observations)
        {
            // all sections are true
            var current = new TrafficLightDigits(88);

            foreach (var o in observations)
            {
                // all sections are false
                if (current.Equals(TrafficLightDigits.Default))
                {
                    return(current);
                }

                current = JoinBrokenSections(o.TrafficLight.Digits, current);
            }

            return(JoinBrokenSections(trafficLight.Digits, current));
        }
Esempio n. 2
0
 private static bool AreAllSectionsServiceable(TrafficLightDigits digits)
 {
     return(digits.Equals(TrafficLightDigits.Default));
 }