Пример #1
0
 public EnginesStats(EnginesDB engines, VesselWrapper vsl)
     : base(vsl)
 {
     engines.SortByRole();
     TorqueInfo = new TorqueInfo(VSL);
     for (int i = 0, count = engines.Count; i < count; i++)
     {
         var e = engines[i];
         e.InitState();
         e.InitTorque(VSL, EngineOptimizer.C.TorqueRatioFactor);
         e.UpdateCurrentTorque(1);
     }
     engines.OptimizeForZeroTorque(VSL.Physics.MoI);
     for (int i = 0, count = engines.Count; i < count; i++)
     {
         var e        = engines[i];
         var throttle = e.Role == TCARole.MANUAL ? e.limit : e.thrustLimit;
         if (throttle > 0)
         {
             if (e.Role != TCARole.MANEUVER)
             {
                 var thrust = e.nominalCurrentThrust(throttle);
                 MaxThrust    += e.wThrustDir * thrust;
                 MaxDefThrust += e.defThrustDir * thrust;
                 MaxMassFlow  += e.MaxFuelFlow * throttle;
             }
             if (e.isSteering)
             {
                 TorqueLimits.Add(e.specificTorque * e.nominalCurrentThrust(throttle));
             }
         }
     }
     TorqueInfo.Update(TorqueLimits.Max + VSL.Torque.NoEngines.Torque);
 }