Esempio n. 1
0
        public ISystem FindSystem(string name, EDSM.GalacticMapping glist = null)        // in system or name
        {
            ISystem ds1 = SystemClass.GetSystem(name);

            if (ds1 == null)
            {
                HistoryEntry vs = FindByName(name);

                if (vs != null)
                {
                    ds1 = vs.System;
                }
                else if (glist != null)
                {
                    EDSM.GalacticMapObject gmo = glist.Find(name, true, true);

                    if (gmo != null && gmo.points.Count > 0)
                    {
                        return(new SystemClass(gmo.name, gmo.points[0].X, gmo.points[0].Y, gmo.points[0].Z));        // fudge it into a system
                    }
                }
            }

            return(ds1);
        }
        // in system or name
        public static ISystem FindSystem(List<VisitedSystemsClass> visitedSystems, GalacticMapping glist , string name)
        {
            EDDiscovery2.DB.ISystem ds1 = SystemClass.GetSystem(name);

            if (ds1 == null)
            {
                VisitedSystemsClass vs = VisitedSystemsClass.FindByName(visitedSystems, name);

                if (vs != null && vs.HasTravelCoordinates)
                    ds1 = vs.curSystem;
                else
                {
                    GalacticMapObject gmo = glist.Find(name, true, true);

                    if (gmo != null && gmo.points.Count > 0)
                    {
                        return new SystemClass(gmo.name, gmo.points[0].X, gmo.points[0].Y, gmo.points[0].Z);        // fudge it into a system
                    }
                }
            }

            return ds1;
        }