/// <summary> /// Remove intersection from the world /// </summary> public void RemoveIntersection(FourWayIntersection intersection) { // Remove any cars that may be on the intersection foreach (List <Lane> ll in intersection.CurrentTrafficLightState.activeLanes.Values) { foreach (Lane l in ll) { while (l.Vehicles.Count > 0) { RemoveCar(l.Vehicles[0]); } } } // Remove any roads connected to intersection while (intersection.Roads.Count > 0) { RemoveRoad(intersection.Roads[0]); } Intersections.Remove(intersection); }