Example #1
0
        public delegate void FinishLength(int a); //делегат для задачи всем финиша

        public Game(List <Car> cars)
        {
            this.cars       = cars;
            start           = new StartLength(cars[0].SetMilage);
            finish          = new FinishLength(cars[0].SetRouteLenght);
            allCarsFinished = new EventHandler(race_AllCarsFinished);
            //криво, конечно
            for (int i = 1; i < cars.Count; ++i)
            {
                start  += cars[i].SetMilage;
                finish += cars[i].SetRouteLenght;
            }
        }
Example #2
0
        public delegate void FinishLength(int a);//делегат для задачи всем финиша

        public Game(List<Car> cars)
        {
            this.cars = cars;
            start = new StartLength(cars[0].SetMilage);
            finish = new FinishLength(cars[0].SetRouteLenght);
            allCarsFinished = new EventHandler(race_AllCarsFinished);
            //криво, конечно
            for (int i = 1; i < cars.Count; ++i)
            {
                start += cars[i].SetMilage;
                finish += cars[i].SetRouteLenght;
            }
        }