示例#1
0
 public void ControlFligth(object sender, FlightParamsEventArgs e)
 {
     if (e.Plain.Speed >= 50)
     {
         Pilot          = e.Pilot;
         recomendHeight = 7 * e.Plain.Speed - this.Adjustment;
         if (e.Plain.Speed > maxSpeed)
         {
             this.Points += 100;
             this.slow    = true;
         }
         else
         {
             this.slow = false;
         }
         if (Math.Abs(recomendHeight - e.Plain.Height) >= 300 && Math.Abs(recomendHeight - e.Plain.Height) <= 600)
         {
             //25
             this.Points += 25;
         }
         else if (Math.Abs(recomendHeight - e.Plain.Height) >= 600 && Math.Abs(recomendHeight - e.Plain.Height) <= 1000)
         {
             //50
             this.Points += 50;
         }
         else if (Math.Abs(recomendHeight - e.Plain.Height) >= 1000)
         {
             ///crash
             throw (new PlainException("Разбился!!!"));
         }
     }
 }
示例#2
0
 public void OnChangeFlightparams(FlightParamsEventArgs param)
 {
     if (this.Speed > 0 && this.Height > 0 && !this.Vzlet)
     {
         this.Vzlet = true;
     }
     if (this.Speed >= 1000 && !this.MaxSpeed && this.Vzlet)
     {
         this.MaxSpeed = true;
     }
     if (this.Speed == 0 && this.Height == 0 && !this.Posadka && this.Vzlet)
     {
         this.Posadka = true;
     }
     if (changeFlightParams != null)
     {
         changeFlightParams(this, param);
     }
 }