public VehicleTrafficGenerator(Roadway ra, int systemSpeedFactor = 1) { _vgTimer.Interval = 1000 / systemSpeedFactor; _vg = new VehicleGenerator(); _ra = ra; Init(); }
static void Main(string[] args) { //WikipediaWebScraper.SearchGoogleForLinks(); Roadway roadway = new Roadway(); TrafficLightAssembly trafficLightAssembly = new TrafficLightAssembly(roadway, SystemSpeedFactor); VehicleTrafficGenerator vg = new VehicleTrafficGenerator(roadway, SystemSpeedFactor); trafficLightAssembly.TrafficLight.LightChanged += vg.OnLightChanged; roadway.AppearsVehicle += trafficLightAssembly.TrafficCamera.OnAppearsVehicle; Console.ReadKey(); }
public TrafficCamera(Roadway roadwayWatching) { _roadwayWatching = roadwayWatching; }
public TrafficLightAssembly(Roadway roadwayWatching, int systemSpeedFactor = 1) { TrafficLight = new TrafficLight(ON.RedMaxAll, ON.AmberMax, ON.Green, systemSpeedFactor); TrafficCamera = new TrafficCamera(roadwayWatching); }