Esempio n. 1
0
 public static void GeneratePeople_Tick()
 {
     if (TrafficLights[3].CurrLight == TrafficLight.Lights.Green)
     {
         if (CurrentRoadTransit.RightRoad)
         {
             GenerateMembers.RightPeople();
         }
         if (CurrentRoadTransit.LeftRoad)
         {
             GenerateMembers.LeftPeople();
         }
     }
     else if (TrafficLights[2].CurrLight == TrafficLight.Lights.Green)
     {
         if (CurrentRoadTransit.UpRoad)
         {
             GenerateMembers.UpPeople();
         }
         if (CurrentRoadTransit.DownRoad)
         {
             GenerateMembers.DownPeople();
         }
     }
 }
Esempio n. 2
0
        public static void GenerateCar_Tick()
        {
            CarCount.Text = (Convert.ToInt32(CarCount.Text) + 1).ToString();
            switch (R.Next(1, 5))
            {
            case 1:
                GenerateMembers.VerticalLeftCar();
                break;

            case 2:
                GenerateMembers.VerticalRightCar();
                break;

            case 3:
                GenerateMembers.HorizontalUpCar();
                break;

            case 4:
                GenerateMembers.HorizontalDownCar();
                break;
            }
        }