Exemple #1
0
 public void CloneHandler()
 {
     cloneCarCnt++;
     if (cloneCarCnt == cloneCarTime)
     {
         if (cars.Count < 3)
         {
             Car clonedCar = clonableCar.Clone();
             if (clonedCar.x == cars[cars.Count - 1].x)
             {
                 if (clonedCar.x == 4)
                 {
                     clonedCar.x = 1;
                 }
                 else
                 {
                     clonedCar.x = 4;
                 }
             }
             lock (cars)
             {
                 cars.Add(clonedCar);
                 cloneCarCnt = 0;
             }
         }
     }
 }