Example #1
0
        public VehicleTrafficGenerator(Roadway ra, int systemSpeedFactor = 1)
        {
            _vgTimer.Interval = 1000 / systemSpeedFactor;

            _vg = new VehicleGenerator();

            _ra = ra;

            Init();
        }
Example #2
0
        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();
        }
Example #3
0
 public TrafficCamera(Roadway roadwayWatching)
 {
     _roadwayWatching = roadwayWatching;
 }
Example #4
0
        public TrafficLightAssembly(Roadway roadwayWatching, int systemSpeedFactor = 1)
        {
            TrafficLight = new TrafficLight(ON.RedMaxAll, ON.AmberMax, ON.Green, systemSpeedFactor);

            TrafficCamera = new TrafficCamera(roadwayWatching);
        }