Exemplo n.º 1
0
 void ResetDeligate()
 {
     moveAllCars       = null;
     showCarsInfo      = null;
     prepairToStartAll = null;
     isfinishedCar     = null;
     showCarsInfoEnd   = null;
     winner            = 1;
     GC.Collect();
 }
Exemplo n.º 2
0
 /// <summary>
 /// констуктор по умолчанию, запрос количества машин в меню
 /// </summary>
 public Races()
 {
     car               = new List <Car>();
     moveAllCars       = null;
     showCarsInfo      = null;
     prepairToStartAll = null;
     isfinishedCar     = null;
     showCarsInfoEnd   = null;
     winner            = 1;
 }
Exemplo n.º 3
0
        void Prepair()
        {
            foreach (var item in car)
            {
                ///формирую массив методов в делегат
                moveAllCars       += item.MoveCar;
                showCarsInfo      += item.ShowCarInfo;
                showCarsInfoEnd   += item.ShowWhenEndPoint;
                prepairToStartAll += item.PrepearToStart;
                isfinishedCar     += item.CheckFInished;

                ///подписки на начало игры, движение машины, и финиш и изменение скорости
                item.Inicilization += Item_Inicilization;
                item.MoveShowEvent += Item_MoveShowEvent;
                item.Onfinish      += Item_Onfinish;
                item.ChangeSpeed   += Item_ChangeSpeed;
            }
        }