Exemplo n.º 1
0
        public void AddRacer(string Name)
        {
            if (!RaceIsOn)
            {
                Bolide newbolide = new Bolide(Name, TrackWidth, TrackHeight);
                Bolides.Add(newbolide);

                Mechanic newmechanic = new Mechanic(Name, newbolide);
                newmechanic.SetPosition(TrackWidth, TrackHeight);
                Mechanics.Add(newmechanic);


                ReparingLoader newloader = new ReparingLoader(Name, newbolide);
                newloader.SetPosition(TrackWidth, TrackHeight);
                Loaders.Add(newloader);

                SafetyCar safety = new SafetyCar(Name, newbolide);
                safety.SetPosition(TrackWidth, TrackHeight);
                Loaders.Add(safety);

                SetStartGrid();
            }
            else
            {
                throw new Exception("Гонка уже началась! Сначала остановите гонку");
            }
        }
Exemplo n.º 2
0
 public SafetyCar(string Name, Bolide Bolide)
 {
     this.Bolide   = Bolide;
     this.Name     = Name;
     Bolide.Crash += CheckTrack;
 }
Exemplo n.º 3
0
 public Mechanic(string Name, Bolide Bolide)
 {
     this.Name     = Name;
     this.Bolide   = Bolide;
     Bolide.Tires += FixBolide;
 }
Exemplo n.º 4
0
 public ReparingLoader(string Name, Bolide Bolide)
 {
     this.Name     = Name;
     this.Bolide   = Bolide;
     Bolide.Crash += FixBolide;
 }