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)); }
private static bool AreAllSectionsServiceable(TrafficLightDigits digits) { return(digits.Equals(TrafficLightDigits.Default)); }