public EliteDangerousCalculations.FSDSpec GetFSDSpec()      // may be null - not found
        {
            if (IsFSDSlot)
            {
                EliteDangerousCalculations.FSDSpec spec = EliteDangerousCalculations.FindFSD(ClassOf, RatingOf);

                if (spec != null)
                {
                    Engineering?.EngineerFSD(ref spec);
                    return(spec);
                }
            }

            return(null);
        }
Beispiel #2
0
        public EliteDangerousCalculations.FSDSpec.JumpInfo GetJumpInfo()      // can we calc jump range? null if we don't have the info
        {
            EliteDangerousCalculations.FSDSpec fsdspec = ShipInformation?.GetFSDSpec();

            if (fsdspec != null)
            {
                double mass = ShipInformation.HullMass() + ShipInformation.ModuleMass();

                if (mass > 0)
                {
                    return(fsdspec.GetJumpInfo(MaterialCommodity.CargoCount, mass, ShipInformation.FuelLevel, ShipInformation.FuelCapacity / 2));
                }
            }

            return(null);
        }
            public bool EngineerFSD(ref EliteDangerousCalculations.FSDSpec spec)               // perform FSD
            {
                bool done = false;

                EngineeringModifiers mod = FindModification("FSDOptimalMass");

                if (mod != null)
                {
                    spec.OptimalMass = mod.Value;
                    done             = true;
                }

                mod = FindModification("MaxFuelPerJump");
                if (mod != null)
                {
                    spec.MaxFuelPerJump = mod.Value;
                    done = true;
                }

                return(done);
            }
        public EliteDangerousCalculations.FSDSpec GetFSDSpec()          // may be null due to not having the info
        {
            ShipModule fsd = GetModule("Frame Shift Drive");

            EliteDangerousCalculations.FSDSpec spec = fsd?.GetFSDSpec();

            if (spec != null)
            {
                foreach (ShipModule sm in Modules.Values)
                {
                    int classpos;
                    if (sm.Item.Contains("Guardian FSD Booster") && (classpos = sm.Item.IndexOf("Class ")) != -1)
                    {
                        spec.SetFSDBooster(sm.Item[classpos + 6] - '0');
                        break;
                    }
                }
                return(spec);
            }

            return(null);
        }