Exemple #1
0
        private void buttonStart_Click(object sender, EventArgs e)

        {
            stopWatch.Start();

            foreach (PictureBox p in activatedpb)
            {
                p.Image = DrawArea;

                simulation = new Simulation();
                Crossing crossing = new Crossing(p.BackgroundImage, 5, rectanglesWE, rectanglesNS);
                simulation.AddCrossing(crossing);
                //myRect = new Rectangle(8, 77, 8, 8);
                //myCar = new Car(Direction.West, myRect);
                simulation.Start();
                timerTest.Start();
                //ThreadStart thRef = new ThreadStart(myCar.Move);
                //carTest = new Thread(thRef);

                //Makes a new Group
                //Group group1 = new Group("WestEast",rectanglesWE);
                //group[0] = group1;
                //group[0].AddTrafficLight();

                //Group group2 = new Group("NorthSouth", rectanglesNS);
                //group[1] = group2;
                //group[1].AddTrafficLight();

                //carTest.Start();
            }
            //if (simulation.simulationRunning == false)
            //{
            //    simulation.Start();
            //}
            //else
            //    MessageBox.Show("Simulation is running");

            //TESTING CAR MOVEMENT
        }
Exemple #2
0
 public void RemoveCrossing(Crossing c)
 {
     crossings.Remove(c);
 }
Exemple #3
0
 public void AddCrossing(Crossing c)
 {
     crossings.Add(c);
 }